public void runCommit ( boolean forceRollback ) throws HeuristicMixedException , HeuristicRollbackException , RollbackException { if ( trace ) { log . tracef ( "runCommit(forceRollback=%b) invoked in transaction with Xid=%s" , forceRollback , xid ) ; } if ( forceRollback ) { markRollbackOnly ( new RollbackException ( FORCE_ROLLBACK_MESSAGE ) ) ; } int notifyAfterStatus = 0 ; try { if ( status == Status . STATUS_MARKED_ROLLBACK ) { notifyAfterStatus = Status . STATUS_ROLLEDBACK ; rollbackResources ( ) ; } else { notifyAfterStatus = Status . STATUS_COMMITTED ; commitResources ( ) ; } } finally { notifyAfterCompletion ( notifyAfterStatus ) ; DummyBaseTransactionManager . setTransaction ( null ) ; } throwRollbackExceptionIfAny ( forceRollback ) ; }
Runs the second phase of two - phase - commit protocol .