HHH-9312 - Database connection leak with JTA transaction tracking and background thread not releasing database connection
This commit is contained in:
parent
88a93f8c03
commit
9e1afbaf49
|
@ -62,6 +62,10 @@ public class SynchronizationCallbackCoordinatorNonTrackingImpl implements Synchr
|
|||
afterCompletionAction = STANDARD_AFTER_COMPLETION_ACTION;
|
||||
}
|
||||
|
||||
protected final TransactionCoordinator transactionCoordinator() {
|
||||
return transactionCoordinator;
|
||||
}
|
||||
|
||||
private TransactionContext transactionContext() {
|
||||
return transactionCoordinator.getTransactionContext();
|
||||
}
|
||||
|
|
|
@ -79,6 +79,10 @@ public class SynchronizationCallbackCoordinatorTrackingImpl extends Synchronizat
|
|||
// check for it in SessionImpl. See HHH-7910.
|
||||
delayedCompletionHandlingStatus = status;
|
||||
|
||||
// no matter what we need to release the Connection. Not releasing
|
||||
// the Connection here can lead to leaked Connections.
|
||||
transactionCoordinator().getJdbcCoordinator().getLogicalConnection().close();
|
||||
|
||||
log.rollbackFromBackgroundThread( status );
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue