Skip to content

Commit

Permalink
very minor cleanup in SessionImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Dec 15, 2024
1 parent fd1a957 commit 1d3124e
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,25 +448,30 @@ private boolean isJpaBootstrap() {
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;
}

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" );
else {
return true;
}
return false;
}

@Override
Expand Down

0 comments on commit 1d3124e

Please sign in to comment.