Exemplo n.º 1
0
 /** Same comment as for {@link #prepare(javax.transaction.xa.Xid)} applies for commit. */
 public void rollback(Xid externalXid) throws XAException {
   Xid xid = convertXid(externalXid);
   LocalXaTransaction localTransaction1 = getLocalTransactionAndValidateImpl(xid, txTable);
   localTransaction.markForRollback(
       true); // ISPN-879 : make sure that locks are no longer associated to this transactions
   txCoordinator.rollback(localTransaction1);
   forgetSuccessfullyCompletedTransaction(recoveryManager, xid, localTransaction1);
 }
Exemplo n.º 2
0
 @Override
 public void afterCompletion(int status) {
   if (log.isTraceEnabled()) {
     log.tracef("afterCompletion(%s) called for %s.", status, localTransaction);
   }
   if (status == Status.STATUS_COMMITTED) {
     try {
       txCoordinator.commit(localTransaction, false);
     } catch (XAException e) {
       throw new CacheException("Could not commit.", e);
     }
     if (!isGMU) {
       releaseLocksForCompletedTransaction(localTransaction);
     }
   } else if (status == Status.STATUS_ROLLEDBACK) {
     try {
       txCoordinator.rollback(localTransaction);
     } catch (XAException e) {
       throw new CacheException("Could not commit.", e);
     }
   } else {
     throw new IllegalArgumentException("Unknown status: " + status);
   }
 }