Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: Communications link failure due to underlying exception


Advanced Search

Re: Communications link failure due to underlying exception
Posted by: Peter Andrews ()
Date: August 03, 2005 08:48AM

Mark,

I am sorry to have abandoned the thread so long. I had neglected to check 'Send replies to this thread to me via email' and was unaware of any replies.

I did as you suggested several weeks ago and have reduced my numbers of connections etcetera considerably (I had inherited these values as a developer new to the team). I found that I actually do need maxIdle to be almost fifty because of very spikey load and otherwise I was connecting and reconnecting far too often. No big deal.

What is a big deal is that I am getting communication failures at almost any time. I have been using testOnIdle and have verified that the validation queries are running at the interval specified (1 every twenty seconds). Even if I switch to testOnBorrow I still can get errors.

I know that real network problems may occur at any time and I am having our network sysadmin investigate. There is some evidence of this since the errors cluster in time across multiple servers.

I did not get errors of this sort (or at least they were hidden from me) before switching to the 3.1.10 driver and simultaneously changing my params to autoreconnect off and the newer validation query paradigm. (I realize multiple changes at once is problematic but I simply wanted to get rid of all the 'set autocommits' and that drove the new driver, new parameters, etcetera).

Here is a sample of failures I am seeing:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:105)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:148)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:176)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1899)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2348)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2858)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:822)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
at com.airs.utilities.server.Entity.find(Entity.java:1238)

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Socket closed

STACKTRACE:

java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:105)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:148)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:176)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1899)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2348)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2858)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:822)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
at com.airs.utilities.server.Entity.getLastInsert(Entity.java:2250)

* BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1902)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2401)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2858)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:770)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1288)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2269)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:421)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1384)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1727)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:822)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
at com.airs.utilities.server.Entity.find(Entity.java:1382)


I guess the paradigm is to catch and handle all of these errors but that is problematic. My boss is understandably very touchy about large changes to our core db code and is urging me to back out the changes and go back to autoReconnect. I want to do the exception handling but it is tricky -- am I supposed to catch all possible errors, figure out which ones are connection related, make a new connection, and retry? How many times shoudl I try -- 3, 5, ?? Even figuring out which errors to retry on is dicey. In addition to the errors listed here I have also seen a null exception from inside dbcp because the connection is bad.

Options: ReplyQuote


Subject Written By Posted
Communications link failure due to underlying exception Henry Fernandes 02/22/2005 01:11AM
Re: Communications link failure due to underlying exception Tetsuro Ikeda 02/22/2005 02:54AM
Re: Communications link failure due to underlying exception Henry Fernandes 02/22/2005 10:38AM
Re: Communications link failure due to underlying exception Henry Fernandes 02/22/2005 11:48AM
Re: Communications link failure due to underlying exception (My Solution) niyi oladeji 11/01/2007 09:32AM
Re: Communications link failure due to underlying exception Marcelo Chryssovergis 04/15/2005 02:32PM
Re: Communications link failure due to underlying exception Carlos Martins 04/20/2005 08:00AM
Re: Communications link failure due to underlying exception Raed Kuhail 05/15/2005 02:48AM
Re: Communications link failure due to underlying exception Michael Carell 06/02/2005 05:06AM
Re: Communications link failure due to underlying exception Alper Akture 07/11/2005 07:27PM
Re: Communications link failure due to underlying exception Peter Andrews 07/15/2005 08:52AM
Re: Communications link failure due to underlying exception Peter Andrews 07/15/2005 11:49AM
Re: Communications link failure due to underlying exception Peter Andrews 07/15/2005 03:22PM
Re: Communications link failure due to underlying exception Peter Andrews 07/19/2005 06:24AM
Re: Communications link failure due to underlying exception Mark Matthews 07/19/2005 07:41AM
Re: Communications link failure due to underlying exception Alper Akture 07/20/2005 12:03PM
Re: Communications link failure due to underlying exception Mark Matthews 07/20/2005 12:06PM
Re: Communications link failure due to underlying exception Alper Akture 07/20/2005 02:06PM
Re: Communications link failure due to underlying exception Mark Matthews 07/20/2005 02:08PM
Re: Communications link failure due to underlying exception Alper Akture 07/20/2005 02:36PM
Re: Communications link failure due to underlying exception Peter Andrews 08/03/2005 08:48AM
Re: Communications link failure due to underlying exception suma latha 03/10/2007 02:23AM
Re: Communications link failure due to underlying exception Mark Matthews 07/19/2005 07:34AM
Re: Communications link failure due to underlying exception YoungSung Lee 06/08/2007 02:09AM
Re: Communications link failure due to underlying exception M Jersan 06/13/2005 04:36AM
Re: Communications link failure due to underlying exception Alper Akture 07/20/2005 04:44PM
Re: Communications link failure due to underlying exception Mark Matthews 07/20/2005 06:03PM
Re: Communications link failure due to underlying exception Alper Akture 07/21/2005 11:11AM
Re: Communications link failure due to underlying exception Philipp Kuhrs 08/10/2005 07:48AM
Re: Communications link failure due to underlying exception Prafulla Girgaonkar 03/22/2006 08:20AM
Re: Communications link failure due to underlying exception Erwin Liem 03/23/2006 05:22AM
Re: Communications link failure due to underlying exception Prafulla Girgaonkar 03/23/2006 10:07AM
CORRECT SOLUTION: Communications link failure due to underlying exception Bohdan Bobylak 05/18/2006 10:22AM
Re: CORRECT SOLUTION: Communications link failure due to underlying exception Adam Pickett 05/29/2006 06:41AM
Re: CORRECT SOLUTION: Communications link failure due to underlying exception virtual spy 06/04/2006 02:47PM
Re: Communications link failure due to underlying exception Qaiser Mehmood 06/01/2006 12:44PM
MySQL fix?! Markus Cozowicz 06/09/2006 04:42AM
Re: MySQL fix?! Akhil 08/24/2006 05:27PM
Re: Communications link failure due to underlying exception Harikrishnan K 11/01/2006 05:52AM
Re: Communications link failure due to underlying exception Alex S 11/30/2006 11:31PM
Re: Communications link failure due to underlying exception Mahesh Yamsani 01/17/2007 11:19PM
date_format() bug, supposed fixed in 4.1.22 Alex S 11/30/2006 11:37PM
Re: date_format() bug, supposed fixed in 4.1.22 (confirmed) Alex S 12/01/2006 12:44AM
Re: Communications link failure due to underlying exception Jeff Smith 05/23/2007 04:29PM
Re: Communications link failure due to underlying exception (My Solution) Carlos Vela 01/18/2007 10:57AM
Solution C3p0 Re: Communications link failure due to underlying exception (My Solution) Richipal Singh 04/01/2007 04:10AM
Re: Solution C3p0 Ole van Boeckel 07/15/2007 04:27AM
Re: Communications link failure due to underlying exception sivakumar s 03/12/2008 03:51AM
Re: Communications link failure due to underlying exception thina karan 04/08/2008 05:43AM
java.policy most of the time! Andrei Todea 04/09/2008 06:01PM
Re: java.policy most of the time! Pape CISSE 05/13/2009 06:18AM
Re: Communications link failure due to underlying exception Venkata Raju 05/02/2008 01:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.