Hi All,
I am using hibernate,Mysql and JBOSS server,i want to know how can i keep the database connection alive,i would communication link failure error after some period of time, I am sing c3p0 ,but it dint helped me out.
Can anyone say what configuration i should do to set for production.
I have used c3p0 to query the db,these r the settings i have done
in hibernate.cfg.xml
<property name="hibernate.c3p0.idle_test_period">25200</property>
and i have c3p0 jar file and property file contains
c3p0.preferredTestQuery=SELECT userName from test.user where userName='admin'
c3p0.testConnectionOnCheckout=true
even with these query its not keeping the mysql connection alive.And i want to know if no one pings within 8hrs whether we need to restart the server?if not how can i manage with c3p0,its not working fine.I have to restart the server if no one pings for 8hrs.
CAn any one suggest me the solution,i want to keep it running.
Thankx.
|