diff --git a/jdbc/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java b/jdbc/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java index 4cf0757427..2f7a5a2b1f 100644 --- a/jdbc/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java +++ b/jdbc/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java @@ -31,6 +31,7 @@ public static void bindResource(DataSource key, ConnectionHolder value) { public static ConnectionHolder unbindResource(DataSource key) { Map map = resources.get(); if (map.isEmpty() || !map.containsKey(key)) { + resources.remove(); return null; } return map.remove(key);