@NotNull public Xid[] recover(final int flag, final String parentNodeName) throws XAException { try { try { final Xid[] xids = ext.doRecover(null, parentNodeName); return xids == null ? SimpleXid.NO_XIDS : xids; } catch (NotSupportedException e) { throw new XAException(XAException.XAER_RMFAIL); } } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } } }
if (doNotImport) { imported = false; transaction = ext.getTransaction(xid); final TransactionImportResult result = ext.importTransaction(xid, timeout); transaction = result.getTransaction(); imported = result.isNewImportedTransaction();
switch (tpo) { case PREPARE_READONLY: ext.removeImportedTransaction(gtid); return XAResource.XA_RDONLY; } catch (HeuristicCommitException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { ext.removeImportedTransaction(gtid); ext.removeImportedTransaction(gtid); throw initializeSuppressed(Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, t), importedTransaction);
public Transaction findExistingTransaction(final Xid xid) throws XAException { try { final SimpleXid simpleXid = SimpleXid.of(xid); final SimpleXid gtid = simpleXid.withoutBranch(); final ConcurrentMap<SimpleXid, Entry> known = JBossLocalTransactionProvider.this.known; Entry entry = known.get(gtid); if (entry != null) { return entry.getTransaction(); } final Transaction transaction = ext.getTransaction(xid); if (transaction == null) { return null; } return known.computeIfAbsent(gtid, g -> getEntryFor(transaction, g)).getTransaction(); } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } }
public Transaction findExistingTransaction(final Xid xid) throws XAException { try { final SimpleXid simpleXid = SimpleXid.of(xid); final SimpleXid gtid = simpleXid.withoutBranch(); final ConcurrentMap<SimpleXid, Entry> known = JBossLocalTransactionProvider.this.known; Entry entry = known.get(gtid); if (entry != null) { return entry.getTransaction(); } final Transaction transaction = ext.getTransaction(xid); if (transaction == null) { return null; } return known.computeIfAbsent(gtid, g -> getEntryFor(transaction, g)).getTransaction(); } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } }
if (doNotImport) { imported = false; transaction = ext.getTransaction(xid); final TransactionImportResult result = ext.importTransaction(xid, timeout); transaction = result.getTransaction(); imported = result.isNewImportedTransaction();
JBossLocalTransactionProvider(final ExtendedJBossXATerminator ext, final int staleTransactionTime, final TransactionManager tm, final XAResourceRecoveryRegistry registry, final Path xaRecoveryDirRelativeToPath) { Assert.checkMinimumParameter("setTransactionTimeout", 0, staleTransactionTime); this.staleTransactionTime = staleTransactionTime; this.ext = Assert.checkNotNullParam("ext", ext); this.tm = Assert.checkNotNullParam("tm", tm); try { ext.doRecover(null, null); } catch (Exception e) { // the recover method is called to load transactions from Narayana object store at startup // if it fails we ignore, troubles will be adjusted during runtime Log.log.doRecoverFailureOnIntialization(e); } this.fileSystemXAResourceRegistry = new FileSystemXAResourceRegistry(this, xaRecoveryDirRelativeToPath); registry.addXAResourceRecovery(fileSystemXAResourceRegistry::getInDoubtXAResources); }
throw Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, e); } finally { ext.removeImportedTransaction(gtid);
public Transaction findExistingTransaction(final Xid xid) throws XAException { try { final SimpleXid simpleXid = SimpleXid.of(xid); final SimpleXid gtid = simpleXid.withoutBranch(); final ConcurrentMap<SimpleXid, Entry> known = JBossLocalTransactionProvider.this.known; Entry entry = known.get(gtid); if (entry != null) { return entry.getTransaction(); } final Transaction transaction = ext.getTransaction(xid); if (transaction == null) { return null; } return known.computeIfAbsent(gtid, g -> getEntryFor(transaction, g)).getTransaction(); } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } }
if (doNotImport) { imported = false; transaction = ext.getTransaction(xid); final TransactionImportResult result = ext.importTransaction(xid, timeout); transaction = result.getTransaction(); imported = result.isNewImportedTransaction();
if (! importedTransaction.doCommit()) { dropLocal(importedTransaction); ext.doRecover(null, null); throw new XAException(XAException.XA_RETRY);
switch (tpo) { case PREPARE_READONLY: ext.removeImportedTransaction(gtid); return XAResource.XA_RDONLY; } catch (HeuristicCommitException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { ext.removeImportedTransaction(gtid); ext.removeImportedTransaction(gtid); throw initializeSuppressed(Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, t), importedTransaction);
@NotNull public Xid[] recover(final int flag, final String parentNodeName) throws XAException { try { try { final Xid[] xids = ext.doRecover(null, parentNodeName); return xids == null ? SimpleXid.NO_XIDS : xids; } catch (NotSupportedException e) { throw new XAException(XAException.XAER_RMFAIL); } } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } } }
switch (tpo) { case PREPARE_READONLY: ext.removeImportedTransaction(gtid); return XAResource.XA_RDONLY; } catch (HeuristicCommitException | HeuristicMixedException | HeuristicRollbackException | SystemException e) { ext.removeImportedTransaction(gtid); ext.removeImportedTransaction(gtid); throw initializeSuppressed(Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, t), importedTransaction);
@NotNull public Xid[] recover(final int flag, final String parentNodeName) throws XAException { try { try { final Xid[] xids = ext.doRecover(null, parentNodeName); return xids == null ? SimpleXid.NO_XIDS : xids; } catch (NotSupportedException e) { throw new XAException(XAException.XAER_RMFAIL); } } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } } }
throw Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, e); } finally { ext.removeImportedTransaction(gtid);
JBossLocalTransactionProvider(final ExtendedJBossXATerminator ext, final int staleTransactionTime, final TransactionManager tm, final XAResourceRecoveryRegistry registry, final Path xaRecoveryDirRelativeToPath) { Assert.checkMinimumParameter("setTransactionTimeout", 0, staleTransactionTime); this.staleTransactionTime = staleTransactionTime; this.ext = Assert.checkNotNullParam("ext", ext); this.tm = Assert.checkNotNullParam("tm", tm); try { ext.doRecover(null, null); } catch (Exception e) { // the recover method is called to load transactions from Narayana object store at startup // if it fails we ignore, troubles will be adjusted during runtime Log.log.doRecoverFailureOnIntialization(e); } this.fileSystemXAResourceRegistry = new FileSystemXAResourceRegistry(this, xaRecoveryDirRelativeToPath); registry.addXAResourceRecovery(fileSystemXAResourceRegistry::getInDoubtXAResources); }
throw Log.log.resourceManagerErrorXa(XAException.XAER_RMERR, e); } finally { ext.removeImportedTransaction(gtid);
JBossLocalTransactionProvider(final ExtendedJBossXATerminator ext, final int staleTransactionTime, final TransactionManager tm, final XAResourceRecoveryRegistry registry, final Path xaRecoveryDirRelativeToPath) { Assert.checkMinimumParameter("setTransactionTimeout", 0, staleTransactionTime); this.staleTransactionTime = staleTransactionTime; this.ext = Assert.checkNotNullParam("ext", ext); this.tm = Assert.checkNotNullParam("tm", tm); try { ext.doRecover(null, null); } catch (Exception e) { // the recover method is called to load transactions from Narayana object store at startup // if it fails we ignore, troubles will be adjusted during runtime Log.log.doRecoverFailureOnIntialization(e); } this.fileSystemXAResourceRegistry = new FileSystemXAResourceRegistry(this, xaRecoveryDirRelativeToPath); registry.addXAResourceRecovery(fileSystemXAResourceRegistry::getInDoubtXAResources); }
if (! importedTransaction.doCommit()) { dropLocal(importedTransaction); ext.doRecover(null, null); throw new XAException(XAException.XA_RETRY);