0

What happens when timeBetweenEvictionRunsMillis of Tomcat 8 JDBC connection pool is set to -1?

The tomcat wiki says it should not be less than 1 second:

timeBetweenEvictionRunsMillis - (int) The number of milliseconds to sleep between runs of the idle connection validation/cleaner thread. This value should not be set under 1 second. It dictates how often we check for idle, abandoned connections, and how often we validate idle connections. The default value is 5000 (5 seconds).

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
Saran
  • 213
  • 2
  • 5
  • 13

1 Answers1

0

It effect isPoolSweeperEnabled() function in tomcat 8 JDBC pool. if value is less than 0 it won't enable Pool Sweeper.

The pool sweeper is enabled if any settings that require async intervention in the pool are turned on boolean result = getTimeBetweenEvictionRunsMillis()>0

It effect queries to restrict number of connection define in maxActive

maximum number of connections that should be kept in the idle pool if isPoolSweeperEnabled() returns false. If the If isPoolSweeperEnabled() returns true, then the idle pool can grow up to getMaxActive() and will be shrunk according to getMinEvictableIdleTimeMillis()

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • Does it have any effect with the queries execution? we have select queries failing with exceptions (We are using Enterprise DB) if tomcat jdbc pool is enabled which work fine if the pooling is disabled – Saran Nov 07 '17 at 10:49
  • Add details in answer – Ori Marko Nov 07 '17 at 10:57