Do not close transactional Connection in doReleaseConnection

Closes gh-28133
This commit is contained in:
Juergen Hoeller
2023-10-11 15:43:02 +02:00
parent 66ce8c9a25
commit 80e82cd43f
2 changed files with 4 additions and 2 deletions

View File

@@ -178,6 +178,7 @@ public abstract class ConnectionFactoryUtils {
if (conHolder != null && connectionEquals(conHolder, connection)) {
// It's the transactional Connection: Don't close it.
conHolder.released();
return Mono.empty();
}
return Mono.from(connection.close());
}).onErrorResume(NoTransactionException.class, ex -> Mono.from(connection.close()));