diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java index ea441326..9c1f230f 100644 --- a/src/main/java/com/zaxxer/hikari/HikariConfig.java +++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java @@ -811,9 +811,13 @@ public class HikariConfig implements HikariConfigMXBean logger.warn("idleTimeout is less than 10000ms, setting to default {}ms.", IDLE_TIMEOUT); idleTimeout = IDLE_TIMEOUT; } - else if (idleTimeout > maxLifetime && maxLifetime > 0) { - logger.warn("idleTimeout is greater than maxLifetime, setting to maxLifetime."); - idleTimeout = maxLifetime; + if (idleTimeout > maxLifetime && maxLifetime > 0) { + logger.warn("idleTimeout is greater than maxLifetime, , disabling it."); + idleTimeout = 0; + } + if (maxLifetime == 0 && idleTimeout == 0) { + logger.warn("setting idleTimeout to {}ms.", IDLE_TIMEOUT); + idleTimeout = IDLE_TIMEOUT; } if (leakDetectionThreshold != 0 && leakDetectionThreshold < TimeUnit.SECONDS.toMillis(2) && !unitTest) { diff --git a/src/main/java/com/zaxxer/hikari/pool/PoolElf.java b/src/main/java/com/zaxxer/hikari/pool/PoolElf.java index 76d72f22..6560a47a 100644 --- a/src/main/java/com/zaxxer/hikari/pool/PoolElf.java +++ b/src/main/java/com/zaxxer/hikari/pool/PoolElf.java @@ -175,7 +175,7 @@ public final class PoolElf void setupConnection(final Connection connection, final long connectionTimeout) throws SQLException { if (isUseJdbc4Validation && !isJdbc4ValidationSupported(connection)) { - throw new SQLException("Connection.isValid() method is not supported, connection test query must be configured"); + throw new SQLException("Connection.isValid() is not supported, configure connection test query."); } networkTimeout = getAndSetNetworkTimeout(connection, connectionTimeout); @@ -269,7 +269,7 @@ public final class PoolElf } if (LOGGER.isDebugEnabled()) { - LOGGER.debug("{} - Reset ({}) on connection {}", resetBits != 0 ? stringFromResetBits(resetBits) : "nothing", poolEntry.connection); + LOGGER.debug("{} - Reset ({}) on connection {}", poolName, resetBits != 0 ? stringFromResetBits(resetBits) : "nothing", poolEntry.connection); } }