I can replicate this problem in a quick fashion by setting MySQL's wait_timeout to a very low value, such as 35 seconds.
I've since attempted to use c3p0 to handle connections. But, I'm not having any luck with that either.
I've got these lines in my hibernate.properties file:
Code:
hibernate.c3p0.acquire_increment=3
hibernate.c3p0.idle_test_period=15
hibernate.c3p0.timeout=120
hibernate.c3p0.max_size=15
hibernate.c3p0.max_statements=0
hibernate.c3p0.min_size=3
And, these lines in my c3p0.properties file:
Code:
c3p0.preferredTestQuery=SELECT 1
c3p0.initialPoolSize=3
c3p0.maxConnectionAge=15
c3p0.idleConnectionTestPeriod=15
c3p0.testConnectionsOnCheckin=true
c3p0.testConnectionOnCheckout=true
c3p0.acquireRetryAttempts=30
When I run my webapp, I do see the values from hibernate.properties being used. However, I never see any mention of the c3p0.properties values. Both hibernate.properties and c3p0.properties are in my WEB-INF/classes/ path. Is there some newer convention for loading the additional c3p0 variables?