Getting below exception on my prod server, but it resolves automatically after few hours. What could be the reason for this issue
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was234747 milliseconds ago.The last packet sent successfully to the server was 234747 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.
We have set autoReconnect=true already, From Forums I found that we need enable idle connections test. Please advise
Will it be any unclosed connections in the application causes this exception?
we use Ibatis and below is the Ibatisconfig file
<transactionManager type="JDBC" commitRequired="true">
<dataSource type="SIMPLE">
<property name="JDBC.Driver" value="com.mysql.jdbc.Driver" />
<property name="JDBC.ConnectionURL"
value="<URL>?autoReconnect=true" />
<property name="JDBC.Username" value="<username>" />
<property name="JDBC.Password" value="<password>" />
<property name="JDBC.DefaultAutoCommit" value="false" />
<property name="Pool.TimeToWait" value="100" />
<property name="Pool.PingQuery" value="select 1" />
<property name="Pool.PingEnabled" value="true" />
<property name="Pool.PingConnectionsOlderThan" value="300000" />
<property name="Pool.PingConnectionsNotUsedFor" value="300000" />
</dataSource>
</transactionManager>