C
carmelo
Hi everybody,
I use TopLink as persistence provider, and I wondered how it was
possible to restore the connection to the database after a drop in
service.
Let me explain better, with the following code I get the JDBC
connection from the entityManager:
Connection jdbcConnection =
((oracle.toplink.essentials.ejb.cmp3.EntityManager)
entityManager).getServerSession().getDefaultConnectionPool().acquireConnection().getConnection();
Before carrying out any operation, I check if the connection is valid
and active with:
jdbcConnection.isValid (timeout)
After a drop of service or a line fall, connection is always inactive,
how can I do to restore it without restarting the application?
Thank you very much in advance!
I use TopLink as persistence provider, and I wondered how it was
possible to restore the connection to the database after a drop in
service.
Let me explain better, with the following code I get the JDBC
connection from the entityManager:
Connection jdbcConnection =
((oracle.toplink.essentials.ejb.cmp3.EntityManager)
entityManager).getServerSession().getDefaultConnectionPool().acquireConnection().getConnection();
Before carrying out any operation, I check if the connection is valid
and active with:
jdbcConnection.isValid (timeout)
After a drop of service or a line fall, connection is always inactive,
how can I do to restore it without restarting the application?
Thank you very much in advance!