public void distributeCommit ( ) throws SystemException , HeuristicHazardException , HeuristicMixedException , HeuristicRollbackException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeCommit" ) ; final TransactionState ts = _transaction . getTransactionState ( ) ; ts . setCommittingStateUnlogged ( ) ; // Shuffle resources around according to commit priority order _retryRequired = sortResources ( ) ; if ( ! _retryRequired ) { _outcome = true ; _retryRequired = distributeOutcome ( ) ; } else { updateHeuristicOutcome ( StatefulResource . HEURISTIC_HAZARD ) ; } if ( _systemException != null ) { final Throwable toThrow = new SystemException ( ) . initCause ( _systemException ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , toThrow ) ; throw ( SystemException ) toThrow ; } // check for heuristics ... as we will move forget processing to TransactionImpl later if ( HeuristicOutcome . isHeuristic ( _heuristicOutcome ) ) { switch ( _heuristicOutcome ) { case StatefulResource . HEURISTIC_COMMIT : break ; case StatefulResource . HEURISTIC_ROLLBACK : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , "HeuristicRollbackException" ) ; throw new HeuristicRollbackException ( ) ; case StatefulResource . HEURISTIC_HAZARD : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , "HeuristicHazardException" ) ; throw new HeuristicHazardException ( ) ; default : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , "HeuristicMixedException" ) ; throw new HeuristicMixedException ( ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" ) ; }
Distributes commit messages to all Resources in the registered state .