当前位置: 动力学知识库 > 问答 > 编程问答 >

java - timeout in MYSQL

问题描述:

I have a java application that has long running processes and interact with db. It keeps getting the following:

The 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

分享给朋友:
您可能感兴趣的文章:
随机阅读: