Answer the question
In order to leave comments, you need to log in
How to troubleshoot a database connection?
In fact, I need to carry out the following actions:
Connecting, disconnecting and searching for signs of life in the database.
The question is how it is done in hibernate.
Answer the question
In order to leave comments, you need to log in
In JDBC4, the driver does this by implementing the Connection#isValid() method.
Earlier versions use (at least in connection pool libraries) validation queries like SELECT 1;
By the way, I'm not sure that hibernate checks connections. Most likely this is usually done by pools.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question