Fixed #174. Move pool filling code to after the housekeeping thread has started.

pull/192/head
Brett Wooldridge 10 years ago
parent 05fcb3d00d
commit 267005cd9d

@ -1,5 +1,10 @@
HikariCP Changes
Changes between 2.2.0 and 2.2.1
* Fixed issue with pool initialization of MySQL after default value of
initializationFailFast property was changed to false.
Changes between 2.1.0 and 2.2.0
* Generate proxy classes into the same protection domain as the HikariCP

@ -149,14 +149,14 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
addConnectionExecutor = createThreadPoolExecutor(configuration.getMaximumPoolSize(), "HikariCP connection filler (pool " + configuration.getPoolName() + ")", configuration.getThreadFactory(), new ThreadPoolExecutor.DiscardPolicy());
closeConnectionExecutor = createThreadPoolExecutor(4, "HikariCP connection closer (pool " + configuration.getPoolName() + ")", configuration.getThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy());
fillPool();
long delayPeriod = Long.getLong("com.zaxxer.hikari.housekeeping.periodMs", TimeUnit.SECONDS.toMillis(30L));
houseKeepingExecutorService = new ScheduledThreadPoolExecutor(1, configuration.getThreadFactory() != null ? configuration.getThreadFactory() : new DefaultThreadFactory("Hikari Housekeeping Timer (pool " + configuration.getPoolName() + ")", true));
if (IS_JAVA7) {
houseKeepingExecutorService.setRemoveOnCancelPolicy(true);
}
houseKeepingExecutorService.scheduleAtFixedRate(new HouseKeeper(), delayPeriod, delayPeriod, TimeUnit.MILLISECONDS);
fillPool();
}
/**

@ -148,12 +148,12 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
addConnectionExecutor = createThreadPoolExecutor(configuration.getMaximumPoolSize(), "HikariCP connection filler (pool " + configuration.getPoolName() + ")", configuration.getThreadFactory(), new ThreadPoolExecutor.DiscardPolicy());
closeConnectionExecutor = createThreadPoolExecutor(4, "HikariCP connection closer (pool " + configuration.getPoolName() + ")", configuration.getThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy());
fillPool();
long delayPeriod = Long.getLong("com.zaxxer.hikari.housekeeping.periodMs", TimeUnit.SECONDS.toMillis(30L));
houseKeepingExecutorService = new ScheduledThreadPoolExecutor(1, configuration.getThreadFactory() != null ? configuration.getThreadFactory() : new DefaultThreadFactory("Hikari Housekeeping Timer (pool " + configuration.getPoolName() + ")", true));
houseKeepingExecutorService.setRemoveOnCancelPolicy(true);
houseKeepingExecutorService.scheduleAtFixedRate(new HouseKeeper(), delayPeriod, delayPeriod, TimeUnit.MILLISECONDS);
fillPool();
}
/**

Loading…
Cancel
Save