users@glassfish.java.net

Re: JMS connection

From: <glassfish_at_javadesktop.org>
Date: Sun, 21 Jun 2009 11:36:38 PDT

When wait_timeout expires my application fails to reconnect to the database and throws the exception below (I'm using v2.1). This wasn't a problem until we moved from MySQL 4.1.7 with Connector/J 3.1 to MySQL 5.0 and Connector/J 5.1. Setting autoReconnect=true doesn't have any impact, nor does AutoReconnectForPools=true or AutoReconnectForConnectionPools=true (though if anyone could explain the differences between these variables, I would be delighted.) Connection validation is required (I'm using the table method), though it is not set to close all connections on failure. My idle timeout is at 300 seconds and my wait_timeout is the default 8 hours. I haven't seen any other suggestions for fixing this problem, does anyone know how to get around it?

MySQL documentation seems to suggest that autoReconnect is, or soon will be, deprecated, and that all applications should deal with this issue by handling the CommunicationsException. It seems to me that my container should be doing this, right?


[#|2009-03-04T14:02:43.789-0600|WARNING|sun-appserver2.1|oracle.toplink.essentials.session.file:/opt/glassfish/domains/internal/applications/j2ee-modules/myapp/-NewtPU|_ThreadID=14;_ThreadName=http
SSLWorkerThread-8181-0;_RequestID=31c89a9d-59ab-4668-8553-bdcd53912e5a;|
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was85533 milliseconds ago.The last packet sent successfully to the server was 85533 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.
Error Code: 0
Call: SELECT AccountID, DateDeactivated, DateCreated, AcctMgr, RefContactID FROM Accounts WHERE (AccountID = ?)
bind => [1000213]
Query: ReadObjectQuery(com.myco.myapp.Account)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
at
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was85533 milliseconds ago.The last packet sent successfully to the server was 85533 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.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

___________
[url=http://betonline.com/sportsbook]sportsbook[/url]
[url=http://www.northstarlimo.ca/reservations.aspx]toronto downtown to airport[/url]
[Message sent by forum member 'karthick9s' (karthick9s)]

http://forums.java.net/jive/thread.jspa?messageID=352264