/** * this is driven by a coordinator-completion participant registered on behalf of the coordinator * and is required to propagate the complete to all registered coordinator-completion participants. * @return the result of preparing the transaction */ public void complete () throws WrongStateException, SystemException { // if this goes wrong here then we will throw an exception super.complete(); // now we need to run phase one of commit // TODO -- need to do completion processing here? int outcome = super.prepare(true); // if we have prepared ok (or are read only) then status will be COMMITTING if (outcome == TwoPhaseOutcome.PREPARE_NOTOK) { // phase 1 failed so we need to run phase 2 abort // this will set status to ABORTED phase2Abort(true); } // no need to return anything as the caller can just check the status }
/** * this is driven by a coordinator-completion participant registered on behalf of the coordinator * and is required to propagate the complete to all registered coordinator-completion participants. * @return the result of preparing the transaction */ public void complete () throws WrongStateException, SystemException { // if this goes wrong here then we will throw an exception super.complete(); // now we need to run phase one of commit // TODO -- need to do completion processing here? int outcome = super.prepare(true); // if we have prepared ok (or are read only) then status will be COMMITTING if (outcome == TwoPhaseOutcome.PREPARE_NOTOK) { // phase 1 failed so we need to run phase 2 abort // this will set status to ABORTED phase2Abort(true); } // no need to return anything as the caller can just check the status }
/** * this is driven by a coordinator-completion participant registered on behalf of the coordinator * and is required to propagate the cancel to all registered participants. */ public int cancel () { int status = status(); int result; // TODO -- check if there is a window here where status could change to COMMITTING if (status == ActionStatus.COMMITTING) { phase2Abort(true); result = status(); } else { result = super.cancel(); } SubordinateBACoordinator.removeRecoveredCoordinator(this); // run any callback associated with this transaction runCallback(get_uid().stringForm()); return result; }
/** * this is driven by a coordinator-completion participant registered on behalf of the coordinator * and is required to propagate the cancel to all registered participants. */ public int cancel () { int status = status(); int result; // TODO -- check if there is a window here where status could change to COMMITTING if (status == ActionStatus.COMMITTING) { phase2Abort(true); result = status(); } else { result = super.cancel(); } SubordinateBACoordinator.removeRecoveredCoordinator(this); // run any callback associated with this transaction runCallback(get_uid().stringForm()); return result; }
super.phase2Abort( _reportHeuristics ) ; SubordinateBACoordinator.removeRecoveredCoordinator(this);
super.phase2Abort( _reportHeuristics ) ; SubordinateBACoordinator.removeRecoveredCoordinator(this);
super.phase2Abort( _reportHeuristics ) ; SubordinateBACoordinator.removeRecoveredCoordinator(this);