Author: kfujino Date: Wed Jul 22 07:16:42 2015 New Revision: 1692226 URL: http://svn.apache.org/r1692226 Log: If the timeBetweenEvictionRunsMillis attribute is changed via jmx, it should restart the pool cleaner because this attribute affects the execution interval of the pool cleaner.
Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java?rev=1692226&r1=1692225&r2=1692226&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Wed Jul 22 07:16:42 2015 @@ -633,8 +633,14 @@ public class ConnectionPool extends Noti getPoolProperties().setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled(); //make sure pool cleaner starts/stops when it should - if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties()); - else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner(); + if (!wasEnabled && shouldBeEnabled) { + pool.initializePoolCleaner(getPoolProperties()); + } else if (wasEnabled) { + pool.terminatePoolCleaner(); + if (shouldBeEnabled) { + pool.initializePoolCleaner(getPoolProperties()); + } + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org