@ -129,7 +129,7 @@ public class HikariConfig implements HikariConfigMXBean
isInitializationFailFast = true ;
isInitializationFailFast = true ;
String systemProp = System . getProperty ( "hikaricp.configurationFile" ) ;
String systemProp = System . getProperty ( "hikaricp.configurationFile" ) ;
if ( systemProp ! = null ) {
if ( systemProp ! = null ) {
loadProperties ( systemProp ) ;
loadProperties ( systemProp ) ;
}
}
}
}
@ -245,10 +245,6 @@ public class HikariConfig implements HikariConfigMXBean
else {
else {
this . connectionTimeout = connectionTimeoutMs ;
this . connectionTimeout = connectionTimeoutMs ;
}
}
if ( validationTimeout > connectionTimeoutMs ) {
this . validationTimeout = connectionTimeoutMs ;
}
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@ -265,13 +261,8 @@ public class HikariConfig implements HikariConfigMXBean
if ( validationTimeoutMs < 250 ) {
if ( validationTimeoutMs < 250 ) {
throw new IllegalArgumentException ( "validationTimeout cannot be less than 250ms" ) ;
throw new IllegalArgumentException ( "validationTimeout cannot be less than 250ms" ) ;
}
}
else {
this . validationTimeout = validationTimeoutMs ;
}
if ( validationTimeout > connectionTimeout ) {
this . validationTimeout = validationTimeoutMs ;
this . validationTimeout = connectionTimeout ;
}
}
}
/ * *
/ * *
@ -661,6 +652,7 @@ public class HikariConfig implements HikariConfigMXBean
* Set the default password to use for DataSource . getConnection ( username , password ) calls .
* Set the default password to use for DataSource . getConnection ( username , password ) calls .
* @param password the password
* @param password the password
* /
* /
@Override
public void setPassword ( String password )
public void setPassword ( String password )
{
{
this . password = password ;
this . password = password ;
@ -736,6 +728,7 @@ public class HikariConfig implements HikariConfigMXBean
*
*
* @param username the username
* @param username the username
* /
* /
@Override
public void setUsername ( String username )
public void setUsername ( String username )
{
{
this . username = username ;
this . username = username ;
@ -821,9 +814,9 @@ public class HikariConfig implements HikariConfigMXBean
}
}
if ( idleTimeout + SECONDS . toMillis ( 1 ) > maxLifetime & & maxLifetime > 0 ) {
if ( idleTimeout + SECONDS . toMillis ( 1 ) > maxLifetime & & maxLifetime > 0 ) {
LOGGER . warn ( "{} - idleTimeout is close to or more than maxLifetime, disabling it." , poolName ) ;
LOGGER . warn ( "{} - idleTimeout is close to or more than maxLifetime, disabling it." , poolName ) ;
idleTimeout = 0 ;
idleTimeout = 0 ;
}
}
if ( idleTimeout ! = 0 & & idleTimeout < SECONDS . toMillis ( 10 ) ) {
if ( idleTimeout ! = 0 & & idleTimeout < SECONDS . toMillis ( 10 ) ) {
LOGGER . warn ( "{} - idleTimeout is less than 10000ms, setting to default {}ms." , poolName , IDLE_TIMEOUT ) ;
LOGGER . warn ( "{} - idleTimeout is less than 10000ms, setting to default {}ms." , poolName , IDLE_TIMEOUT ) ;
@ -831,32 +824,21 @@ public class HikariConfig implements HikariConfigMXBean
}
}
if ( leakDetectionThreshold > 0 & & ! unitTest ) {
if ( leakDetectionThreshold > 0 & & ! unitTest ) {
if ( leakDetectionThreshold < SECONDS . toMillis ( 2 ) | | ( leakDetectionThreshold > maxLifetime & & maxLifetime > 0 ) ) {
if ( leakDetectionThreshold < SECONDS . toMillis ( 2 ) | | ( leakDetectionThreshold > maxLifetime & & maxLifetime > 0 ) ) {
LOGGER . warn ( "{} - leakDetectionThreshold is less than 2000ms or more than maxLifetime, disabling it." , poolName ) ;
LOGGER . warn ( "{} - leakDetectionThreshold is less than 2000ms or more than maxLifetime, disabling it." , poolName ) ;
leakDetectionThreshold = 0 ;
leakDetectionThreshold = 0 ;
}
}
}
}
if ( connectionTimeout ! = Integer . MAX_VALUE ) {
if ( connectionTimeout < 250 ) {
if ( connectionTimeout < 250 ) {
LOGGER . warn ( "{} - connectionTimeout is less than 250ms, setting to {}ms." , poolName , CONNECTION_TIMEOUT ) ;
LOGGER . warn ( "{} - connectionTimeout is less than 250ms, setting to {}ms." , poolName , CONNECTION_TIMEOUT ) ;
connectionTimeout = CONNECTION_TIMEOUT ;
connectionTimeout = CONNECTION_TIMEOUT ;
}
if ( maxLifetime > 0 & & connectionTimeout > maxLifetime ) {
LOGGER . warn ( "{} - connectionTimeout is more than maxLifetime, setting connectionTimeout to maxLifetime." , poolName ) ;
connectionTimeout = maxLifetime ;
}
}
}
if ( validationTimeout < 250 ) {
if ( validationTimeout < 250 ) {
LOGGER . warn ( "{} - validationTimeout is less than 250ms, setting to {}ms." , poolName , VALIDATION_TIMEOUT ) ;
LOGGER . warn ( "{} - validationTimeout is less than 250ms, setting to {}ms." , poolName , VALIDATION_TIMEOUT ) ;
validationTimeout = VALIDATION_TIMEOUT ;
validationTimeout = VALIDATION_TIMEOUT ;
}
}
else if ( validationTimeout > connectionTimeout ) {
LOGGER . warn ( "{} - validationTimeout is more than connectionTimeout, setting validationTimeout to connectionTimeout." , poolName ) ;
validationTimeout = connectionTimeout ;
}
if ( maxPoolSize < 0 ) {
if ( maxPoolSize < 0 ) {
if ( minIdle < 0 ) {
if ( minIdle < 0 ) {