Restore db connection after service drop

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top