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に追加しました。明らかな影響はありません。問題はここにあるものになど
任意のアイデア? ありがとう pat
は、http://stackoverflow.com/q/667289/778687 – tusar
@tusarリンクのおかげで、この記事を参照してください。なぜ私はたくさんのコードを書いているのかを説明します。興味深いことに、彼らは自動再接続を非難しています。 – fishtoprecords
サーバ上でwait_timeoutがどのように設定されていますか? –