Skip to content

Commit 1d3124e

Browse files
committed
very minor cleanup in SessionImpl
1 parent fd1a957 commit 1d3124e

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,25 +448,30 @@ private boolean isJpaBootstrap() {
448448
private boolean isTransactionInProgressAndNotMarkedForRollback() {
449449
if ( waitingForAutoClose ) {
450450
return getSessionFactory().isOpen()
451-
&& getTransactionCoordinator().isTransactionActive( false );
451+
&& isTransactionActive();
452452
}
453453
else {
454454
return !isClosed()
455-
&& getTransactionCoordinator().isTransactionActive( false );
455+
&& isTransactionActive();
456456
}
457457
}
458458

459+
private boolean isTransactionActive() {
460+
return getTransactionCoordinator().isTransactionActive( false );
461+
}
462+
459463
@Override
460464
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared) {
461-
if ( !isTransactionCoordinatorShared ) {
462-
return super.shouldCloseJdbcCoordinatorOnClose( isTransactionCoordinatorShared );
465+
if ( isTransactionCoordinatorShared ) {
466+
final ActionQueue actionQueue = getActionQueue();
467+
if ( actionQueue.hasBeforeTransactionActions() || actionQueue.hasAfterTransactionActions() ) {
468+
log.warn( "On close, shared Session had before/after transaction actions that have not yet been processed" );
469+
}
470+
return false;
463471
}
464-
465-
final ActionQueue actionQueue = getActionQueue();
466-
if ( actionQueue.hasBeforeTransactionActions() || actionQueue.hasAfterTransactionActions() ) {
467-
log.warn( "On close, shared Session had before/after transaction actions that have not yet been processed" );
472+
else {
473+
return true;
468474
}
469-
return false;
470475
}
471476

472477
@Override

0 commit comments

Comments
 (0)