use of javax.transaction.HeuristicCommitException in project narayana by jbosstm.
the class TransactionImple method doRollback.
public void doRollback() throws IllegalStateException, HeuristicMixedException, HeuristicCommitException, HeuristicRollbackException, SystemException {
try {
SubordinateAtomicAction subAct = (SubordinateAtomicAction) super._theTransaction;
if (!endSuspendedRMs()) {
jtaLogger.i18NLogger.warn_transaction_arjunacore_endsuspendfailed1();
}
// JBTM-927 the transaction reaper may have aborted this transaction already
int res = subAct.status() == ActionStatus.ABORTED ? ActionStatus.ABORTED : subAct.doRollback();
switch(res) {
case ActionStatus.ABORTED:
case ActionStatus.ABORTING:
TransactionImple.removeTransaction(this);
break;
case ActionStatus.H_ROLLBACK:
throw new HeuristicRollbackException();
case ActionStatus.H_COMMIT:
throw new HeuristicCommitException();
case ActionStatus.H_HAZARD:
case ActionStatus.H_MIXED:
throw new HeuristicMixedException();
default:
throw new HeuristicMixedException();
}
} catch (ClassCastException ex) {
ex.printStackTrace();
UnexpectedConditionException unexpectedConditionException = new UnexpectedConditionException(ex.toString());
unexpectedConditionException.initCause(ex);
throw unexpectedConditionException;
}
}
Aggregations