very minor cleanup in SessionImpl
This commit is contained in:
parent
fd1a957c13
commit
1d3124e06d
|
@ -448,25 +448,30 @@ public class SessionImpl
|
||||||
private boolean isTransactionInProgressAndNotMarkedForRollback() {
|
private boolean isTransactionInProgressAndNotMarkedForRollback() {
|
||||||
if ( waitingForAutoClose ) {
|
if ( waitingForAutoClose ) {
|
||||||
return getSessionFactory().isOpen()
|
return getSessionFactory().isOpen()
|
||||||
&& getTransactionCoordinator().isTransactionActive( false );
|
&& isTransactionActive();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return !isClosed()
|
return !isClosed()
|
||||||
&& getTransactionCoordinator().isTransactionActive( false );
|
&& isTransactionActive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isTransactionActive() {
|
||||||
|
return getTransactionCoordinator().isTransactionActive( false );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared) {
|
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared) {
|
||||||
if ( !isTransactionCoordinatorShared ) {
|
if ( isTransactionCoordinatorShared ) {
|
||||||
return super.shouldCloseJdbcCoordinatorOnClose( 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 {
|
||||||
final ActionQueue actionQueue = getActionQueue();
|
return true;
|
||||||
if ( actionQueue.hasBeforeTransactionActions() || actionQueue.hasAfterTransactionActions() ) {
|
|
||||||
log.warn( "On close, shared Session had before/after transaction actions that have not yet been processed" );
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue