From 0da14c8ce95aa1f8ac4a6055741a6bf27b7b7ac7 Mon Sep 17 00:00:00 2001 From: Nitin Date: Tue, 6 Oct 2015 19:52:15 +0530 Subject: [PATCH 1/2] align log with 'Before cleanup' --- src/main/java/com/zaxxer/hikari/pool/HikariPool.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java index 857c4865..1940025c 100644 --- a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java +++ b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java @@ -442,6 +442,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL // Speculative increment of totalConnections with expectation of success if (totalConnections.incrementAndGet() > config.getMaximumPoolSize()) { totalConnections.decrementAndGet(); // Pool is maxed out, so undo speculative increment of totalConnections + LOGGER.debug("{} - Cannot exceed maximum connections capacity: {}", poolName, config.getMaximumPoolSize()); return true; } @@ -487,7 +488,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL addConnectionExecutor.execute(new Runnable() { @Override public void run() { - logPoolState("After fill\t"); + logPoolState("After adding\t"); } }); } From 49be257130ba7bc3080f5bc8a0f191db86f23394 Mon Sep 17 00:00:00 2001 From: Nitin Date: Tue, 6 Oct 2015 22:15:07 +0530 Subject: [PATCH 2/2] commented log & added changes removed from old commit --- CHANGES | 24 +++++++++++++++++++ .../com/zaxxer/hikari/pool/HikariPool.java | 2 +- .../pool/TestConnectionTimeoutRetry.java | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e77f64b2..9e3c3693 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,29 @@ HikariCP Changes +Changes in 2.4.2 + + * Fixed issue with proxy generation whereby the generated classes contain the + major version number for Java 8, which makes them incompatible with the Java 7 + runtime. + + * Improve accuracy of timeouts for getConnection() calls by accounting for possibly + long delay aliveness tests. + + * Improve adherence to minimumIdle goal by closing idle connections starting from + longest idle time to shortest. Additionally, stop when minimumIdle is reached even + if connections exceeding idleTimeout remain (but are still within maxLifetime). + + * Ongoing com.zaxxer.hikari.metrics refactors. This is not considered public API until + such time as we announce it. Caveat lector. + + * Performance improvements in the getConnection()/close() hot path. + + * issue 415: remove use of java.beans classes to allow use of HikariCP with the + Zulu JRE compact3 profile. + + * issue 406: execute validation query during connection setup to make sure it is + valid SQL. + Changes in 2.4.1 * issue 380: housekeeper was not being scheduled in the case of a user specified diff --git a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java index 1940025c..a40717e9 100644 --- a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java +++ b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java @@ -442,7 +442,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL // Speculative increment of totalConnections with expectation of success if (totalConnections.incrementAndGet() > config.getMaximumPoolSize()) { totalConnections.decrementAndGet(); // Pool is maxed out, so undo speculative increment of totalConnections - LOGGER.debug("{} - Cannot exceed maximum connections capacity: {}", poolName, config.getMaximumPoolSize()); + //LOGGER.debug("{} - Cannot exceed maximum connections capacity: {}", poolName, config.getMaximumPoolSize()); return true; } diff --git a/src/test/java/com/zaxxer/hikari/pool/TestConnectionTimeoutRetry.java b/src/test/java/com/zaxxer/hikari/pool/TestConnectionTimeoutRetry.java index c8c9d277..176788d4 100644 --- a/src/test/java/com/zaxxer/hikari/pool/TestConnectionTimeoutRetry.java +++ b/src/test/java/com/zaxxer/hikari/pool/TestConnectionTimeoutRetry.java @@ -236,7 +236,7 @@ public class TestConnectionTimeoutRetry Thread.sleep(2000); - Assert.assertSame("Totals connections not as expected", 10, TestElf.getPool(ds).getTotalConnections()); + Assert.assertSame("Total connections not as expected", 10, TestElf.getPool(ds).getTotalConnections()); Assert.assertSame("Idle connections not as expected", 3, TestElf.getPool(ds).getIdleConnections()); connection1.close();