From 3990d259a1e8dbff7f7361a3ee0f0ffcc1c94952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Darri=20Sigur=C3=B0sson?= Date: Wed, 6 Dec 2023 10:46:59 +0000 Subject: [PATCH] Fixes #2152 Duplicate connection in try with resources clause caused close() being called twice on each connection. --- src/main/java/com/zaxxer/hikari/pool/PoolBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/zaxxer/hikari/pool/PoolBase.java b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java index 90e3252b..ab5276a2 100644 --- a/src/main/java/com/zaxxer/hikari/pool/PoolBase.java +++ b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java @@ -133,7 +133,7 @@ abstract class PoolBase logger.debug("{} - Closing connection {}: {}", poolName, connection, closureReason); // continue with the close even if setNetworkTimeout() throws - try (connection; connection) { + try (connection) { if (!connection.isClosed()) setNetworkTimeout(connection, SECONDS.toMillis(15)); } catch (SQLException e) {