Bug #38742 com.mysql.jdbc.CommunicationsException: Communications link failure.
Submitted: 12 Aug 2008 8:51 Modified: 12 Aug 2008 10:42
Reporter: pranita hh Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Errors Severity:S1 (Critical)
Version:mysql connector 5.0.8 OS:Any
Assigned to:

[12 Aug 2008 8:51] pranita hh
Description:
Hi All,
    I am using mysql 5.0.8 connector and tomcat 6.0.10 DBCP.
    My Application works well for few weeks, but after few weeks it get fail reporting the error,

com.mysql.jdbc.CommunicationsException: Communications link failure

Last packet sent to the server was 1553186 ms ago.
	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070)
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1383)
	at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at com.adobe.gep.database.managers.DBConnection.executeQuery(DBConnection.java:76)
	

Caused by: java.net.SocketException: Connection reset
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
	

It gets resolve after restarting the tomcat.
I am properly closing the connections but unable to understand the reason for this bug.

If anyone have some idea then plz tell me. 

How to repeat:
Hi All,
    I am using mysql 5.0.8 connector and tomcat 6.0.10 DBCP.
    My Application works well for few weeks, but after few weeks it get fail reporting the error,

com.mysql.jdbc.CommunicationsException: Communications link failure

Last packet sent to the server was 1553186 ms ago.
	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070)
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1383)
	at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at com.adobe.gep.database.managers.DBConnection.executeQuery(DBConnection.java:76)
	

Caused by: java.net.SocketException: Connection reset
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
	

It gets resolve after restarting the tomcat.
I am properly closing the connections but unable to understand the reason for this bug.

If anyone have some idea then plz tell me.
[12 Aug 2008 9:03] pranita hh
Here is the description of the configurations that I made in tomcat context file,
      type="javax.sql.DataSource"
      maxActive="100" 
      maxIdle="30" 
      maxWait="10000" 
      testOnBorrow="true"
      testWhileIdle="true" 
      driverClassName="com.mysql.jdbc.Driver"
[12 Aug 2008 10:42] Sveta Smirnova
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.

Please read about tcpKeepAlive at http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html