try {
rollback ( getCoordinator().isRecoverableWhileActive().booleanValue() , false );
throw new RollbackException ( msg );
} catch ( HeurCommitException e ) {
LOGGER.logWarning ( "Illegal heuristic commit during rollback:" + e );
throw new HeurMixedException ( e.getHeuristicMessages() );
}
}
// start messages
Enumeration enumm = participants.elements ();
while ( enumm.hasMoreElements () ) {
Participant p = (Participant) enumm.nextElement ();
if ( !readOnlyTable_.containsKey ( p ) ) {
CommitMessage cm = new CommitMessage ( p, commitresult,
onePhase );
// if onephase: set cascadelist anyway, because if the
// participant is a REMOTE one, then it might have
// multiple participants that are not visible here!
if ( onePhase && cascadeList_ != null ) { // null for OTS
Integer sibnum = (Integer) cascadeList_.get ( p );
if ( sibnum != null ) // null for local participant!
p.setGlobalSiblingCount ( sibnum.intValue () );
p.setCascadeList ( cascadeList_ );
}
propagator_.submitPropagationMessage ( cm );
}
} // while
commitresult.waitForReplies ();
int res = commitresult.getResult ();
if ( res != TerminationResult.ALL_OK ) {
if ( res == TerminationResult.HEUR_MIXED ) {
Hashtable hazards = commitresult.getPossiblyIndoubts ();
Hashtable heuristics = commitresult
.getHeuristicParticipants ();
addToHeuristicMap ( heuristics );
enumm = participants.elements ();
while ( enumm.hasMoreElements () ) {
Participant p = (Participant) enumm.nextElement ();
if ( !heuristics.containsKey ( p ) )
addToHeuristicMap ( p, TxState.TERMINATED );
}
nextStateHandler = new HeurMixedStateHandler ( this,
hazards );
coordinator_.setStateHandler ( nextStateHandler );
throw new HeurMixedException ( getHeuristicMessages () );
}
else if ( res == TerminationResult.ROLLBACK ) {
// 1PC and rolled back before commit arrived.
nextStateHandler = new TerminatedStateHandler ( this );