/** * 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 }