tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: MySQL timeout
Date Sat, 01 Mar 2014 17:16:58 GMT

did you configure dbcp to test regularly the connection? see see
validationQuery, timeBetweenEvictionRunsMillis etc...
Romain Manni-Bucau
Twitter: @rmannibucau

2014-03-01 16:52 GMT+01:00 Chris Christo <>:
> Hey guys,
> Quick question. I have my war deployed on OpenEJB standalone 4.6.0 which has a jta managed
data source connecting to a local MySQL db. If the app doesn't get used (i.e an api call or
whatever) for like 24 hours or so then the db connection times out. After making a couple
of subsequent calls it 'wakes up' and responds normally. I'm assuming here that the db connection
is reestablished and all things become normal again.
> I'm not really sure what to do to stop the connection being dropped. I'm assuming I have
to increase the session timeout or something? Is this done on the OpenEJB side or MySQL side?
anyone had this problem and solved it?
> The stack trace is as follows:
> Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully
received from the server was 963,156,961 milliseconds ago.  The last packet sent successfully
to the server was 963,156,961 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

View raw message