public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); return status; }
public int doCommit () { super.phase2Commit(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); return toReturn; }
public int doRollback () { super.phase2Abort(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); return toReturn; }
toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK:
public int doCommit () { super.phase2Commit(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); return toReturn; }
public int doPrepare () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if ( !(status == ActionStatus.ABORT_ONLY || status == ActionStatus.ABORTING) && doBeforeCompletion()) { int outcome = super.prepare(true); if(outcome == TwoPhaseOutcome.PREPARE_READONLY) { // we won't get called again, so we need to clean up // and run the afterCompletions before returning. doCommit(); } return outcome; } else { super.phase2Abort(true); return TwoPhaseOutcome.PREPARE_NOTOK; } }
public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); TransactionReaper.transactionReaper().remove(this); return status; }
public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); TransactionReaper.transactionReaper().remove(this); return status; }
public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); TransactionReaper.transactionReaper().remove(this); return status; }
public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); TransactionReaper.transactionReaper().remove(this); return status; }
public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); TransactionReaper.transactionReaper().remove(this); return status; }
public int doOnePhaseCommit () { int status = super.status(); // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if (status == ActionStatus.ABORT_ONLY || doBeforeCompletion()) { status = super.End(true); } else { status = ActionStatus.ABORTED; } afterCompletion(status); TransactionReaper.transactionReaper().remove(this); return status; }
public int doRollback () { super.phase2Abort(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); TransactionReaper.transactionReaper().remove(this); return toReturn; }
public int doCommit () { super.phase2Commit(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); TransactionReaper.transactionReaper().remove(this); return toReturn; }
public int doRollback () { super.phase2Abort(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); TransactionReaper.transactionReaper().remove(this); return toReturn; }
public int doPrepare () { int status = super.status(); // JBTM-927 it is possible this transaction has been aborted by the TransactionReaper if (status == ActionStatus.ABORTED) { return TwoPhaseOutcome.PREPARE_NOTOK; } // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if ( !(status == ActionStatus.ABORT_ONLY || status == ActionStatus.ABORTING) && doBeforeCompletion()) { int outcome = super.prepare(true); if(outcome == TwoPhaseOutcome.PREPARE_READONLY) { // we won't get called again, so we need to clean up // and run the afterCompletions before returning. doCommit(); } return outcome; } else { super.phase2Abort(true); super.afterCompletion(Status.STATUS_ROLLEDBACK); return TwoPhaseOutcome.PREPARE_NOTOK; } }
public int doRollback () { super.phase2Abort(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); TransactionReaper.transactionReaper().remove(this); return toReturn; }
public int doRollback () { super.phase2Abort(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); TransactionReaper.transactionReaper().remove(this); return toReturn; }
public int doRollback () { super.phase2Abort(true); int toReturn; switch (super.getHeuristicDecision()) { case TwoPhaseOutcome.PREPARE_OK: case TwoPhaseOutcome.FINISH_OK: toReturn = super.status(); break; case TwoPhaseOutcome.HEURISTIC_ROLLBACK: toReturn = ActionStatus.H_ROLLBACK; break; case TwoPhaseOutcome.HEURISTIC_COMMIT: toReturn = ActionStatus.H_COMMIT; break; case TwoPhaseOutcome.HEURISTIC_MIXED: toReturn = ActionStatus.H_MIXED; break; case TwoPhaseOutcome.HEURISTIC_HAZARD: default: toReturn = ActionStatus.H_HAZARD; break; } super.afterCompletion(toReturn); TransactionReaper.transactionReaper().remove(this); return toReturn; }
public int doPrepare () { int status = super.status(); // JBTM-927 it is possible this transaction has been aborted by the TransactionReaper if (status == ActionStatus.ABORTED) { return TwoPhaseOutcome.PREPARE_NOTOK; } // In JTA spec, beforeCompletions are run on commit attempts only, not rollbacks. // We attempt to mimic that here, even though we are outside the scope of the spec. // note it's not perfect- async timeout/rollback means there is a race condition in which we // can still call beforeCompletion on rollbacks, but that's not too bad as skipping it is really // just an optimization anyhow. JBTM-429 if ( !(status == ActionStatus.ABORT_ONLY || status == ActionStatus.ABORTING) && doBeforeCompletion()) { int outcome = super.prepare(true); if(outcome == TwoPhaseOutcome.PREPARE_READONLY) { // we won't get called again, so we need to clean up // and run the afterCompletions before returning. doCommit(); } return outcome; } else { super.phase2Abort(true); super.afterCompletion(Status.STATUS_ROLLEDBACK); return TwoPhaseOutcome.PREPARE_NOTOK; } }