diff --git a/CHANGES b/CHANGES index 102fc23a6..14586f4db 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ HikariCP Changes +Changes in 6.2.1 + + * change default keepaliveTime to 2 minutes + + * fix commons-compress dependency, make test scope + Changes in 6.2.0 * merged #2238 handle SQLTimeoutException without eviction. Users looking to preserve previous behavior diff --git a/README.md b/README.md index ebb0a22e8..c99cc85a0 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ pool. The 'ping' is one of either: invocation of the JDBC4 `isValid()` method, o `connectionTestQuery`. Typically, the duration out-of-the-pool should be measured in single digit milliseconds or even sub-millisecond, and therefore should have little or no noticeable performance impact. The minimum allowed value is 30000ms (30 seconds), but a value in the range of minutes is most desirable. -*Default: 0 (disabled)* +*Default: 120000 (2 minutes)* ⏳``maxLifetime``
This property controls the maximum lifetime of a connection in the pool. An in-use connection will @@ -373,8 +373,8 @@ allows you to set an instance of a class, implementing the ``com.zaxxer.hikari.S interface, that will be called before a connection is evicted from the pool due to specific exception conditions. Typically, when a ``SQLException`` is thrown, connections are evicted from the pool when specific *SQLStates* or *ErrorCodes* are present. The ``adjudicate()`` method will be called on the -``SQLExceptionOverride`` instance, which may return one of: ``Override.CONTINUE_EVICT``. -``Override.DO_NOT_EVICT`` or ``Override.MUST_EVICT``. Except in very specific cases +``SQLExceptionOverride`` instance, which may return one of: ``Override.CONTINUE_EVICT``. +``Override.DO_NOT_EVICT`` or ``Override.MUST_EVICT``. Except in very specific cases ``Override.CONTINUE_EVICT`` should be returned, allowing the default evict/no-evict logic to execute. *Default: none* diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java index 289232839..c902c3301 100644 --- a/src/main/java/com/zaxxer/hikari/HikariConfig.java +++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java @@ -52,7 +52,7 @@ public class HikariConfig implements HikariConfigMXBean private static final long SOFT_TIMEOUT_FLOOR = Long.getLong("com.zaxxer.hikari.timeoutMs.floor", 250L); private static final long IDLE_TIMEOUT = MINUTES.toMillis(10); private static final long MAX_LIFETIME = MINUTES.toMillis(30); - private static final long DEFAULT_KEEPALIVE_TIME = 0L; + private static final long DEFAULT_KEEPALIVE_TIME = MINUTES.toMillis(2); private static final int DEFAULT_POOL_SIZE = 10; private static boolean unitTest = false; @@ -1101,13 +1101,13 @@ private void validateNumerics() // keepalive time must larger than 30 seconds if (keepaliveTime != 0 && keepaliveTime < SECONDS.toMillis(30)) { LOGGER.warn("{} - keepaliveTime is less than 30000ms, disabling it.", poolName); - keepaliveTime = DEFAULT_KEEPALIVE_TIME; + keepaliveTime = 0L; } // keepalive time must be less than maxLifetime (if maxLifetime is enabled) if (keepaliveTime != 0 && maxLifetime != 0 && keepaliveTime >= maxLifetime) { LOGGER.warn("{} - keepaliveTime is greater than or equal to maxLifetime, disabling it.", poolName); - keepaliveTime = DEFAULT_KEEPALIVE_TIME; + keepaliveTime = 0L; } if (leakDetectionThreshold > 0 && !unitTest) {