Bug #44393 com.mysql.jdbc.CommunicationsException
Submitted: 21 Apr 2009 22:18 Modified: 29 Apr 2009 21:56
Reporter: Francesco Maisano Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.31 - 6.3.22 OS:Linux (Redhat 5.2 64 bit)
Assigned to: CPU Architecture:Any
Tags: CommunicationsException, CommunicationsException, MySQL Cluster, MySQL Cluster, weblogic, weblogic

[21 Apr 2009 22:18] Francesco Maisano
Description:
Hello, I have configured a connection pool on weblogic 10.1 using the mysql driver 5.1.7. Every 20 hours or so, is logged the following error:

<Apr 21, 2009 3:22:52 AM CEST> <Error> <JDBC> <BEA-001112> <Test "SELECT 1" set up for pool "DATA_SOURCE" failed with exception: "com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was54163 milliseconds ago.The last packet sent successfully to the server was 54163 milliseconds ago, which  is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.".> 

The load balancing is managed by weblogic and in the connection string there is no connection attribute.
What could be because this problem?

How to repeat:
I can not understand how to repeat that error, that is, in that context occurs.
[27 Apr 2009 16:17] Francesco Maisano
How come I have not received any information about it?
[28 Apr 2009 0:32] Mark Matthews
This is not a bug. The error message itself says that your connection pool is letting connections sit idle longer than the configuration value 'wait_timeout' on the mysqld server. Either configure your pool to not do that, or better yet configure it to validate connections before handing them out, or while idle.

If you've configured your connection pool correctly, and the problems persist, please re-open the bug and post your configuration so that we can figure out what is going on.
[28 Apr 2009 13:12] Francesco Maisano
I am not sure about one thing, why the wait_timeout parameter is set to 28800 seconds and in the log appears that the connection was successful 54163 milliseconds ago?
[28 Apr 2009 15:45] Mark Matthews
The value displayed by the driver was the last time it communicated successfully with the mysql server. Is this a connection to localhost, or some remote machine? Does the connection pass through any firewalls, routers, etc. that might have a shorter timeout than mysql itself?
[29 Apr 2009 21:56] Francesco Maisano
The connection pass through one switch and the ping is 0.100 ms. In addition, the network interfaces are monitored and have never link down.
[29 Apr 2009 21:56] Francesco Maisano
The connection pass through one switch in the same vlan and the ping is 0.100 ms. In addition, the network interfaces are monitored and have never link down.
[29 Apr 2009 21:56] Francesco Maisano
The connection pass through one switch in the same vlan and the ping is 0.100 ms. In addition, the network interfaces are monitored and have never link down.