Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Hibernate
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2008, 06:32 AM
Registered User
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Communications link failure in JBOSS with MYSQL

Hi,

I have a web application running on the JBOSS 4.0 server and Database is MySQL5.0.
We are using MySQL Connection/J as driver template while configuring HIBERNATE3.1

It is running success but we left the application for idle (without doing any operations) it is giving following Exception. Both server and MySQL are running on the same machine.


[org.hibernate.util.JDBCExceptionReporter] could not execute query

com.mysql.jdbc.Communication****ception: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Software caused connection abort: recv failed

STACKTRACE:

java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream. java:129)
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(Read AheadInputStream.java:113)
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromU nderlyingStreamIfNecessary(ReadAheadInputStream.ja va:160)

** END NESTED EXCEPTION **


Last packet sent to the server was 454 ms ago.
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO. java:2586)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:2874)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:16 23)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1715)
    at com.mysql.jdbc.Connection.execSQL(Connection.java: 3249)
2008-08-08 08:01:07,368 ERROR [org.hibernate.util.JDBCExceptionReporter] Communications link failure due to underlying exception:



Also I modified


Please help to advise what's wrong.



skumar
 
Old August 13th, 2008, 03:54 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

As per the trace, you'll get this kind of exception when the connection you are holding is timed out and released, but you try to use the same reference OR when your request for a connection to the database fails [Unable to connect to db].

But as you said you get this exception when the application is idle for some time; its probable will be the first case. Check by modifying the connection timeout value to narrow your case, and find our root cause.
Mostly it'll be connection time out.

- Rakesh
 
Old August 27th, 2008, 11:36 PM
Registered User
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by rakesh_mscit
 As per the trace, you'll get this kind of exception when the connection you are holding is timed out and released, but you try to use the same reference OR when your request for a connection to the database fails [Unable to connect to db].

But as you said you get this exception when the application is idle for some time; its probable will be the first case. Check by modifying the connection timeout value to narrow your case, and find our root cause.
Mostly it'll be connection time out.

- Rakesh
skumar
 
Old August 27th, 2008, 11:43 PM
Registered User
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by skumar
 
Quote:
quote:Originally posted by rakesh_mscit
Quote:
 As per the trace, you'll get this kind of exception when the connection you are holding is timed out and released, but you try to use the same reference OR when your request for a connection to the database fails [Unable to connect to db].

But as you said you get this exception when the application is idle for some time; its probable will be the first case. Check by modifying the connection timeout value to narrow your case, and find our root cause.
Mostly it'll be connection time out.

- Rakesh
Thanks for u u solution i did the same still am facing same.But i resolved it.
we implemetned the scheduler class to resolvue this issue.
Schedular class will execute the for every specific time period.which cals a class which has a DB interaction.


skumar
skumar





Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you link VB6 to Mysql damanka2001 Beginning VB 6 1 September 19th, 2006 01:07 PM
<link> statement - compile failure to see bug VictorVictor BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 April 18th, 2006 02:26 PM
OBDC link to mySQL for MS Access use Ray Pinnegar Access 2 May 17th, 2005 03:37 AM
Communication Link Failure Fixer morpheus Classic ASP Basics 9 February 24th, 2005 09:36 AM
Dynamically Link MySQL Tables at Runtime Rational Access 0 June 27th, 2004 09:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.