Skip to content
Advertisement

java.sql.SQLException: An attempt by a client to checkout a Connection has timed out

I have a java client server which is supposed to establish connection pool on startup but its failing on timeout error. There are so many threads on this same issue but none of the solutions worked for me

AM using jdk 7 and below is the mchange maven dependency

JavaScript

jdbc.properties

JavaScript

Here is my DAO class which establishes connection-pool on server startup

JavaScript

Here is the stacktrace

JavaScript

Can someone please help me whats wrong with my config/code?

Advertisement

Answer

The problem is Generally

Transaction.Begin() is not called directly or indirectly. so this can be a problem with a session, SessionFactory or configurations

You can always debug this by, doing a Query with your session object, if that test query works then add a transaction to it and begin(), commit() appropriately

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement