GenericJDBCException: Cannot open connection error
posted 3 years ago
In one of our Tomcat Apache server version 6, below errors were logged in the log file and we were not able to login to the application. Once we restarted the tomcat apache service then it was working fine. This issue occurs occationally.
02 Mar 2012 12:06:05:131 [WARN] SQL Error: 0, SQLState: null
02 Mar 2012 12:06:05:131 [ERROR] An attempt by a client to checkout a Connection has timed out.
02 Mar 2012 12:48:29:014 [ERROR] Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection
Kindly let me know any solutions if we can resolve the issue without restart of tomcat apache service.
Can show us your DB Connection Pool configuration? One problem with connection pools is that idle connections may time out and become useless. There are pool options that can be set for many databases that help to get around that.
An IDE is no substitute for an Intelligent Developer.