HHH-5982 : Flush checker bugs

This commit is contained in:
Gail Badner 2011-03-04 11:18:34 -08:00
parent 4d5b9f1ca1
commit 747c2dd50d
2 changed files with 5 additions and 3 deletions

View File

@ -139,9 +139,10 @@ public class SynchronizationCallbackCoordinatorImpl implements SynchronizationCa
private static final ManagedFlushChecker STANDARD_MANAGED_FLUSH_CHECKER = new ManagedFlushChecker() {
@Override
public boolean shouldDoManagedFlush(TransactionCoordinator coordinator, int jtaStatus) {
return coordinator.getTransactionContext().isFlushModeNever() &&
return ! coordinator.getTransactionContext().isClosed() &&
! coordinator.getTransactionContext().isFlushModeNever() &&
coordinator.getTransactionContext().isFlushBeforeCompletionEnabled() &&
!JtaStatusHelper.isRollback( jtaStatus );
! JtaStatusHelper.isRollback( jtaStatus );
}
};

View File

@ -1253,7 +1253,8 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
private static class ManagedFlushCheckerImpl implements ManagedFlushChecker {
@Override
public boolean shouldDoManagedFlush(TransactionCoordinator coordinator, int jtaStatus) {
return ! coordinator.getTransactionContext().isFlushModeNever() &&
return ! coordinator.getTransactionContext().isClosed() &&
! coordinator.getTransactionContext().isFlushModeNever() &&
! JtaStatusHelper.isRollback( jtaStatus );
}
}