Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

MySQL Timeout issue

David Beer

2013-01-04

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi All

I periodically get an issue where the connection to my MySQL Database
timesout. I have set the value <property
name="openjpa.ConnectionFactoryProperties" value="autoReconnect=true"/>
in the persistence.xml file and this works most of the time but if there
is a long time between the connection like a few days it timesout. Is
this a case of increasing the timeout value in MySQL or is this a
setting in OpenJpa I need to change?

My stack trace is as follows:

02-Jan-2013 01:44:27 com.copperarrow.utils.autotrial.SNSRecieverServlet
messageProcessed
SEVERE: Problem executin query find by id
<openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: The last packet
successfully received from the server was 187,404,662 milliseconds ago.
The last packet sent successfully to the server was 187,404,662
milliseconds ago. 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
org.apache.openjpa.jdbc.sql.DBDictionary.narrow (DBDictionary.java:4918)
     at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException (DBDictionary.java:4878)

My MySQL Settings are as follows for default timeout.

mysql> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

Thanks

David


©2008 gg3721.com - Jax Systems, LLC, U.S.A.