User information
 Loading ...
Show article in Knowledge Base

 MySQL : Database connection is closed Export knowledge base Export     SubscribeSubscribe      Show article info

If you are using MySQL and find problems similar to the ones below in the logs


  • DataAccessException: Cause exception: java.sql.SQLException: Connection com.mysql.jdbc.JDBC4Connection@59ba9f4f is closed.
  • Or:
  • Catching DataAccessException exception: DataAccessException: Cause exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 55,724,122 milliseconds ago.  The last packet sent successfully to the server was 55,724,122 milliseconds ago. 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.


The problem you are encountering is due to the fact that the database close the database connections.
To solve this, check the system variable "wait_timeout" in your MySQL server to see if you have the default values set. If so, increase this value to 604800 or more, then restart the database server as well as the VisionFlow server. 

More information about this variable is available here:

User comments
 Loading ...