diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
index <HASH>..<HASH> 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
@@ -3065,7 +3065,14 @@ public class Sql {
             handleError(connection, e);
             throw e;
         } finally {
-            if (connection != null) connection.setAutoCommit(savedAutoCommit);
+            if (connection != null) {
+                try {
+                    connection.setAutoCommit(savedAutoCommit);
+                }
+                catch (SQLException e) {
+                    LOG.finest("Caught exception resetting auto commit: " + e.getMessage() + " - continuing");
+                }
+            }
             cacheConnection = false;
             closeResources(connection, null);
             cacheConnection = savedCacheConnection;
GROOVY-<I>: Sql.withTransaction setAutoCommit in finally not wrapped in try/catch