openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Beer <>
Subject MySQL Timeout issue
Date Fri, 04 Jan 2013 12:39:56 GMT
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 
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.

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)



View raw message