0

This application spends most of its time idle, with no requests.

With the default settings, the connection to the database times out after several hours. Then the first request that comes in throws an exception.

What settings do I need to change to ensure this doesn't happen?

Alex R
  • 11,364
  • 15
  • 100
  • 180
  • See https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html. I would use testOnBorrow, along with the necessary validationQuery. Or validationInterval. – JB Nizet Jul 15 '15 at 04:34

1 Answers1

1

Here's an answer I posted a while back on the various connection pool configurations you can use based on load. The example is for mysql but it applies to all connection pool types. For you just go to the section labeled Low Traffic. A sample config file is listed below it.

tomcat 7.0.42 pooling, hibernate 4.2, mysql rock solid autoreconnect solution

Community
  • 1
  • 1
Usman Mutawakil
  • 4,993
  • 9
  • 43
  • 80