Even cleaner connection test check.

pull/201/merge
Brett Wooldridge 10 years ago
parent 66118ff4c4
commit 949bff3997

@ -443,8 +443,9 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
try { try {
connection = (username == null && password == null) ? dataSource.getConnection() : dataSource.getConnection(username, password); connection = (username == null && password == null) ? dataSource.getConnection() : dataSource.getConnection(username, password);
if (configuration.getConnectionTestQuery() == null && !(isUseJdbc4Validation &= isJdbc40Compliant(connection))) { if (isUseJdbc4Validation && !isJdbc40Compliant(connection)) {
LOGGER.error("JDBC4 Connection.isValid() method not supported, connection test query must be configured"); LOGGER.error("JDBC4 Connection.isValid() method not supported, connection test query must be configured");
return true;
} }
final boolean timeoutEnabled = (connectionTimeout != Integer.MAX_VALUE); final boolean timeoutEnabled = (connectionTimeout != Integer.MAX_VALUE);

@ -423,8 +423,9 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
try { try {
connection = (username == null && password == null) ? dataSource.getConnection() : dataSource.getConnection(username, password); connection = (username == null && password == null) ? dataSource.getConnection() : dataSource.getConnection(username, password);
if (configuration.getConnectionTestQuery() == null && !(isUseJdbc4Validation &= isJdbc40Compliant(connection))) { if (isUseJdbc4Validation && !isJdbc40Compliant(connection)) {
LOGGER.error("JDBC4 Connection.isValid() method not supported, connection test query must be configured"); LOGGER.error("JDBC4 Connection.isValid() method not supported, connection test query must be configured");
return true;
} }
final boolean timeoutEnabled = (connectionTimeout != Integer.MAX_VALUE); final boolean timeoutEnabled = (connectionTimeout != Integer.MAX_VALUE);

Loading…
Cancel
Save