From 91f2245786ca3d93b1e70f6512b0f3fd2e6050b1 Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Mon, 24 Mar 2014 00:43:06 +0100 Subject: [PATCH] Disable jdbc4ConnectionTest when connectionTestQuery is set. --- src/main/java/com/zaxxer/hikari/HikariConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java index b063be733..a2d154092 100644 --- a/src/main/java/com/zaxxer/hikari/HikariConfig.java +++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java @@ -466,7 +466,11 @@ else if (idleTimeout < 30000 && idleTimeout != 0) idleTimeout = IDLE_TIMEOUT; } - if (!isJdbc4connectionTest && connectionTestQuery == null) + if (connectionTestQuery != null) + { + isJdbc4connectionTest = false; + } + else if (!isJdbc4connectionTest) { logger.error("Either jdbc4ConnectionTest must be enabled or a connectionTestQuery must be specified."); throw new IllegalStateException("Either jdbc4ConnectionTest must be enabled or a connectionTestQuery must be specified.");