users@glassfish.java.net

JPA problem with connection

From: Dru Devore <ddevore_at_duckhouse.us>
Date: Thu, 02 Oct 2008 09:44:28 -0700
I think I have solved my problem but I wanted to check on the solution to make sure I was doing it right and to see if there is a better solution. I was having a problem with my JDBC connections. The problem is that if I lose connectivity with the DB the connections all die which is expected but they don't seem to recover for an extended period of time.

What I have done to solve the problem:
I turned on Connection Validation using table validation (because I could go hours without any commits) and On Any Failure Close All connections.

Once I made these changes seems to work the way I need it to, solving the problem.

So my question now is am I doing this right or is there a better way of doing connection recovery with EJB3?

Can I do it from the persistence.xml?