때때로 Java/Tomcat6/Debian Squeeze 애플리케이션이 MySql 서버와 통신 할 수 없습니다. Tomcat 응용 프로그램이 프런트 엔드 서버에 있고 MySql이 별도의 MySql 전용 상자에 있습니다. 일반적인 오류는 다음과 같습니다'autoReconnect = true'인 경우에도 MySql JDBC 시간 초과
이com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was56588 milliseconds ago.
The last packet sent successfully to the server was 56588 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.
주어진 타임 아웃 시간이 매우 짧은 것 같습니다 60 초입니다. 1 시간 이상이라면 몇 분마다 DB 서버에 ping을 수행하는 백그라운드 작업을 설정하기 만하면됩니다. AutoReconnect 매개 변수를 여는 URL에 추가했습니다. 명백한 영향은 없습니다.
여기에 어떤 문제가 있습니까? 감사합니다 팻
는 링크에 대한이 게시물 http://stackoverflow.com/q/667289/778687 – tusar
@tusar, 감사를 참조하십시오. 내가 왜 코드를 작성해야하는지 설명합니다. 그들은 자동 - reconnect 비하하고있는 흥미 롭군요. – fishtoprecords
서버에 설정된 wait_timeout은 무엇입니까? –