case Status.STATUS_PREPARED:
// Commit can only occur after a prepare, so must be
// in prepared state first. Any ODMG error is reported
// as a heuristic decision to rollback.
try {
tx.commit();
} catch (TransactionAbortedException except) {
// Transaction cannot commit and was rolledback
throw new XAException(XAException.XA_HEURRB);
} catch (IllegalStateException except) {
throw new XAException(XAException.XAER_PROTO);