com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed

后端 未结 6 2171
闹比i
闹比i 2020-11-30 00:01

I built an application and deployed locally ... and it was working perfectly. I deployed it on a remote server and started getting the exception mentioned in the subject lin

6条回答
  •  半阙折子戏
    2020-11-30 00:34

    MySQL implicitly closed the database connection because the connection has been inactive for too long (34,247,052 milliseconds ≈ 9.5 hours). If your program then fetches a bad connection from the connection-pool that causes the MySQLNonTransientConnectionException: No operations allowed after connection closed.

    MySQL suggests:

    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.

提交回复
热议问题