@Override public void rollback(Xid xid) throws XAException { contextXATerminator.rollback(xid); }
/** * @see javax.resource.spi.XATerminator */ public void rollback(Xid xid) throws XAException { xat.rollback(xid); }
@Override public void rollback(Xid xid) throws XAException { contextXATerminator.rollback(xid); }
@Override public void rollback(Xid xid) throws XAException { contextXATerminator.rollback(xid); }
/** * The participant should undo the work that it controls. The participant * will then return an indication of whether or not it succeeded.. * * @throws WrongStateException * @throws SystemException */ public void rollback() throws WrongStateException, SystemException { txbridgeLogger.logger.trace("BridgeDurableParticipant.rollback(Xid="+xid+")"); try { xaTerminator.rollback(xid); txbridgeLogger.logger.trace("rollback on Xid="+xid+" OK"); } catch (XAException e) { txbridgeLogger.i18NLogger.error_ibdp_rollbackfailed(XAHelper.xidToString(xid), e); } finally { cleanupRefs(); } }
/** * Adds bridges with active REST-AT to inbound bridge manager's mapping. * Rollback subordinate transaction, if bridge cannot be added. */ private void addBridgesToMapping() { if (LOG.isTraceEnabled()) { LOG.trace("InboundBridgeRecoveryModule.addBridgesToMapping"); } final InboundBridgeManager inboundBridgeManager = InboundBridgeManager.getInstance(); for (final InboundBridge bridge : recoveredBridges) { if (!inboundBridgeManager.addInboundBridge(bridge)) { final XATerminator xaTerminator = SubordinationManager.getXATerminator(); try { xaTerminator.rollback(bridge.getXid()); } catch (XAException e) { LOG.warn(e.getMessage(), e); } } } }
/** * Called by the RecoveryManager RECOVERY_BACKOFF_PERIOD seconds * after the completion of the first pass */ @Override public void periodicWorkSecondPass() { txbridgeLogger.logger.trace("InboundBridgeRecoveryManager.periodicWorkSecondPass()"); cleanupRecoveredParticipants(); // the XTS recovery module is registered and hence run before us. Therefore by the time we get here // we know deserialize has been called for any BridgeDurableParticipant for which a log exists. // thus if it's not in our participantsAwaitingRecovery list by now, it's presumed rollback. orphanedXAResourcesAreIdentifiable = true; // Inbound tx may have a JCA tx log but no corresponding XTS Participant (i.e. BridgeDurableParticipant) log. // these can now be identified and rolled back. List<Xid> indoubtSubordinates = getIndoubtSubordinates(); for(Xid xid : indoubtSubordinates) { if(checkXid(xid) == XAResourceOrphanFilter.Vote.ROLLBACK) { txbridgeLogger.logger.trace("rolling back orphaned subordinate tx "+xid); try { xaTerminator.rollback(xid); } catch(XAException e) { txbridgeLogger.i18NLogger.error_ibrm_rollbackerr(XAHelper.xidToString(xid), e); } } } }
/** * Global Transaction */ public void rollback(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { // In the case of single TM, the container directly roll backs the sources. if (!singleTM) { this.xaTerminator.rollback(tc.getXid()); } } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30508, e); } finally { this.transactions.removeTransactionContext(tc); } }
private void rollbackSubordinate() throws HeuristicException { final InboundBridge inboundBridge = getInboundBridge(); try { if (inboundBridge != null) { SubordinationManager.getXATerminator().rollback(inboundBridge.getXid()); } } catch (XAException e) { LOG.warn(e.getMessage(), e); switch (e.errorCode) { case XAException.XA_HEURCOM: throw new HeuristicException(HeuristicType.HEURISTIC_COMMIT); case XAException.XA_HEURRB: throw new HeuristicException(HeuristicType.HEURISTIC_ROLLBACK); case XAException.XA_HEURMIX: throw new HeuristicException(HeuristicType.HEURISTIC_MIXED); case XAException.XA_HEURHAZ: throw new HeuristicException(HeuristicType.HEURISTIC_MIXED); } } }
@Test public void testRollbackSyncViaXATerminator() throws Exception { final Xid xid = new XidImple(new Uid()); final Transaction t = SubordinationManager.getTransactionImporter().importTransaction(xid); final TestSynchronization sync = new TestSynchronization(); t.registerSynchronization(sync); final XATerminator xaTerminator = SubordinationManager.getXATerminator(); xaTerminator.rollback(xid); assertFalse(sync.isBeforeCompletionDone()); assertTrue(sync.isAfterCompletionDone()); assertEquals(javax.transaction.Status.STATUS_ROLLEDBACK, t.getStatus()); }
@Test public void testRollbackSyncViaXATerminatorWithSeparateSync() throws Exception { final Xid xid = new XidImple(new Uid()); final Transaction t = SubordinationManager.getTransactionImporter().importTransaction(xid); final TestSynchronization sync = new TestSynchronization(); t.registerSynchronization(sync); final XATerminator xaTerminator = SubordinationManager.getXATerminator(); final XATerminatorExtensions xaTerminatorExtensions = (XATerminatorExtensions)xaTerminator; xaTerminatorExtensions.beforeCompletion(xid); xaTerminator.rollback(xid); assertTrue(sync.isBeforeCompletionDone()); assertTrue(sync.isAfterCompletionDone()); assertEquals(javax.transaction.Status.STATUS_ROLLEDBACK, t.getStatus()); }