From a310df95d71c0e3248efb9322f6a62a19590402d Mon Sep 17 00:00:00 2001 From: Brett Wooldridge Date: Wed, 25 Feb 2015 00:11:54 +0900 Subject: [PATCH] Fix #269 Guard against drivers that construct an SQLException where the 'cause' is self-referential. Hopefully the cycle is not multi-layers deep, because this check will only guard against one "loop". --- .../src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java b/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java index 1f8fab6d..68318113 100644 --- a/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java +++ b/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java @@ -109,7 +109,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy LOGGER.warn(String.format("Connection %s (%s) marked as broken because of SQLSTATE(%s), ErrorCode(%d).", delegate.toString(), parentPool.toString(), sqlState, sqle.getErrorCode()), sqle); } - else if (sqle.getNextException() instanceof SQLException) { + else if (sqle.getNextException() instanceof SQLException && sqle != sqle.getNextException()) { checkException(sqle.getNextException()); } }