I have a java application that has long running processes and interact with db. It keeps getting the following:
The开发者_如何学C last packet successfully received from the server was 3,601,168 milliseconds ago. The last packet sent successfully to the server was 3,601,166 milliseconds ago.
The remote server has a wait_timeout 354600 which is in seconds. What could be wrong?
There could be a number of problems, but I don't believe wait_timeout is the culprit if your last packet was sent/received about 3600s ago and wait_timeout is 354600s. You could have lost the connection to the server or any other of a number of things. You need to post more about what your code is doing and more about what you expect to happen and what is actually happening.
- Side question: MySQL was designed to create connections relatively quickly. Have you considered using a connection pool rather than continuously using one connection explicitly?
As for Cassio's comment under the question... wait_timeout is in seconds. MySQL Docs - wait_timeout
精彩评论