How to reconnect to the database after the jdbc drops the connection
654325Aug 8 2008 — edited Aug 11 2008I am new to toplink/jpa . I am builiding a web application and using mysql database. Every day when I open the site, I get the Communication failure exception saying the idle time exceeded the wait_timeout and I should try reconnection using Connector/J or using property autoreconnect=true.
In the persistence.xml i used autoReconnect= true. but I still get the same exception.
I can catch this exception but I want to know how can I reconnect using the instance of entityManagetFactory(emf) which is being created at the start of the application.