views:

217

answers:

1

I'm using Hibernate3.2+Websphere6.0+struts1.3..

After deploying ,application works fine. After some idle time ,i will get this type of error repeatedly,am not able to login at all. Im not using any connection pooling. i feel after idle time its not able to connect to the database again..if i restart the server everything works fine for some time...after that same story.. please help me out

A: 

Take a look at what https://www.hibernate.org/214.html has to say about testConnectionOnCheckout:

Don't use it, this feature is very expensive. If set to true, an operation will be performed at every connection checkout to verify that the connection is valid. A better choice is to verify connections periodically using c3p0.idleConnectionTestPeriod.

I had this problem too and if I recall correctly I indeed solved it by tweaking idleConnectionTestPeriod.

Eric