Merge pull request #372 from nitincchauhan/dev

smart idelTimeout and fix passing missing argument to log
pull/384/head
Brett Wooldridge 10 years ago
commit 697f721f69

@ -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) {

@ -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);
}
}

Loading…
Cancel
Save