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 328fc49492..835a30a6c6 100644 --- a/jdbc/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java +++ b/jdbc/src/main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java @@ -14,7 +14,7 @@ private TransactionSynchronizationManager() {} public static Connection getResource(DataSource key) { final Map connectionHolder = resources.get(); - if (connectionHolder == null) { + if (connectionHolder == null || !connectionHolder.containsKey(key)) { return null; }