From 3733dce1118f9f9ecf0bfae9f8ebea97105f4a43 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 28 Oct 2021 10:29:51 +0200 Subject: [PATCH] [jOOQ/jOOQ#12566] JDBCUtils::safeClose methods should debug log stack traces --- .../java/org/jooq/tools/jdbc/JDBCUtils.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/tools/jdbc/JDBCUtils.java b/jOOQ/src/main/java/org/jooq/tools/jdbc/JDBCUtils.java index 0b7e6ab837..5e1405650a 100644 --- a/jOOQ/src/main/java/org/jooq/tools/jdbc/JDBCUtils.java +++ b/jOOQ/src/main/java/org/jooq/tools/jdbc/JDBCUtils.java @@ -629,7 +629,9 @@ public class JDBCUtils { try { connection.close(); } - catch (Exception ignore) {} + catch (Exception ignore) { + log.debug("Error when closing connection", ignore); + } } } @@ -644,7 +646,9 @@ public class JDBCUtils { try { statement.close(); } - catch (Exception ignore) {} + catch (Exception ignore) { + log.debug("Error when closing statement", ignore); + } } } @@ -659,7 +663,9 @@ public class JDBCUtils { try { resultSet.close(); } - catch (Exception ignore) {} + catch (Exception ignore) { + log.debug("Error when closing result set", ignore); + } } } @@ -687,7 +693,9 @@ public class JDBCUtils { try { closeable.close(); } - catch (Exception ignore) {} + catch (Exception ignore) { + log.debug("Error when closing closeable", ignore); + } } } @@ -702,7 +710,9 @@ public class JDBCUtils { try { closeable.close(); } - catch (Exception ignore) {} + catch (Exception ignore) { + log.debug("Error when closing closeable", ignore); + } } }