How to get DB connection state using JPA?
During the server start up(tomcat) I am creating an entitymangerfactory
and storing into the memory. My question is there any way I can check the
connection state during this time?
What is happening now, it is creating an entitymangerfactory object during
startup, but do not test whether the it able to connect the database or
not. With invalid configuration it is creating the entitymanagerfactory
but when we are trying to execute some queries then only i am getting the
exception.
What I have to do if I want to check the connection state during server
startup?
Thanks in advance
-regards, Somnath Guha
No comments:
Post a Comment