/** * this is driven by a coordinator-completion participant registered on behalf of the coordinator * and is required to propagate the close to all registered participants. */ public int close () throws SystemException { int status = status(); int result; if (status == ActionStatus.COMMITTING) { // TODO -- need to do completion processing here? // we already completed and ran phase 1 so do a phase 2 commit phase2Commit(true); result = status(); } else { // we have not yet completed so we can rely upon the parent implementation to do // everything we need result = super.close(); } // if we have completed then remove the coordinator from the recovered coordinators table if (status() != ActionStatus.COMMITTING) { 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 close to all registered participants. */ public int close () throws SystemException { int status = status(); int result; if (status == ActionStatus.COMMITTING) { // TODO -- need to do completion processing here? // we already completed and ran phase 1 so do a phase 2 commit phase2Commit(true); result = status(); } else { // we have not yet completed so we can rely upon the parent implementation to do // everything we need result = super.close(); } // if we have completed then remove the coordinator from the recovered coordinators table if (status() != ActionStatus.COMMITTING) { 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; }
/** * 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; }
public void complete() throws WrongStateException, SystemException { if (!recovered) { // the coordinator will send complete to all participants and then // also run phase one commit. the former may throw an exception. // if the latter succeeds the tx state will be COMMITTING whereas // if it fails it will be ABORTED. try { coordinator.complete(); } catch (com.arjuna.mw.wsas.exceptions.WrongStateException wse) { throw new WrongStateException(wse.getMessage()); } catch (com.arjuna.mw.wsas.exceptions.SystemException se) { throw new SystemException(se.getMessage()); } // if status is COMMITTING then we return allowing the participant to be logged // if status is ABORTED then the participant must fail avoiding any logging if (coordinator.status() == ActionStatus.ABORTED) { manager.fail(BusinessActivityConstants.WSBA_ELEMENT_FAIL_QNAME); } else { // null out the manager so we don't attempt to save it to the log manager = null; } } else { // we should never get asked to complete a recovered activity throw new WrongStateException(); } }
public void complete() throws WrongStateException, SystemException { if (!recovered) { // the coordinator will send complete to all participants and then // also run phase one commit. the former may throw an exception. // if the latter succeeds the tx state will be COMMITTING whereas // if it fails it will be ABORTED. try { coordinator.complete(); } catch (com.arjuna.mw.wsas.exceptions.WrongStateException wse) { throw new WrongStateException(wse.getMessage()); } catch (com.arjuna.mw.wsas.exceptions.SystemException se) { throw new SystemException(se.getMessage()); } // if status is COMMITTING then we return allowing the participant to be logged // if status is ABORTED then the participant must fail avoiding any logging if (coordinator.status() == ActionStatus.ABORTED) { manager.fail(BusinessActivityConstants.WSBA_ELEMENT_FAIL_QNAME); } else { // null out the manager so we don't attempt to save it to the log manager = null; } } else { // we should never get asked to complete a recovered activity throw new WrongStateException(); } }
public void complete() throws WrongStateException, SystemException { if (!recovered) { // the coordinator will send complete to all participants and then // also run phase one commit. the former may throw an exception. // if the latter succeeds the tx state will be COMMITTING whereas // if it fails it will be ABORTED. try { coordinator.complete(); } catch (com.arjuna.mw.wsas.exceptions.WrongStateException wse) { throw new WrongStateException(wse.getMessage()); } catch (com.arjuna.mw.wsas.exceptions.SystemException se) { throw new SystemException(se.getMessage()); } // if status is COMMITTING then we return allowing the participant to be logged // if status is ABORTED then the participant must fail avoiding any logging if (coordinator.status() == ActionStatus.ABORTED) { manager.fail(BusinessActivityConstants.WSBA_ELEMENT_FAIL_QNAME); } else { // null out the manager so we don't attempt to save it to the log manager = null; } } else { // we should never get asked to complete a recovered activity throw new WrongStateException(); } }
int status = coordinator.status();
int status = coordinator.status();
int status = coordinator.status();