very minor cleanup in SessionImpl

This commit is contained in:
Gavin King 2024-12-15 15:46:04 +01:00
parent fd1a957c13
commit 1d3124e06d
1 changed files with 14 additions and 9 deletions

View File

@ -448,26 +448,31 @@ public class SessionImpl
private boolean isTransactionInProgressAndNotMarkedForRollback() {
if ( waitingForAutoClose ) {
return getSessionFactory().isOpen()
&& getTransactionCoordinator().isTransactionActive( false );
&& isTransactionActive();
}
else {
return !isClosed()
&& getTransactionCoordinator().isTransactionActive( false );
&& isTransactionActive();
}
}
private boolean isTransactionActive() {
return getTransactionCoordinator().isTransactionActive( false );
}
@Override
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared) {
if ( !isTransactionCoordinatorShared ) {
return super.shouldCloseJdbcCoordinatorOnClose( isTransactionCoordinatorShared );
}
if ( isTransactionCoordinatorShared ) {
final ActionQueue actionQueue = getActionQueue();
if ( actionQueue.hasBeforeTransactionActions() || actionQueue.hasAfterTransactionActions() ) {
log.warn( "On close, shared Session had before/after transaction actions that have not yet been processed" );
}
return false;
}
else {
return true;
}
}
@Override
public boolean isAutoCloseSessionEnabled() {