/** * If supplied xids contains any values seen on prev scans, replace the existing * XAResource with the supplied one and return true. Otherwise, return false. * * @param xaResource * @param xids * @return */ public boolean updateIfEquivalentRM(XAResource xaResource, Xid[] xids) { if(xids == null || xids.length == 0) { return false; } for(int i = 0; i < xids.length; i++) { if(contains(xids[i])) { _xares = xaResource; return true; } } return false; }
private XAResource getTheKey(Xid xid) { if (_xidScans != null) { Enumeration<XAResource> keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = keys.nextElement(); RecoveryXids xids = _xidScans.get(theKey); // JBTM-1255 moved stale check back to bottomUpRecovery if (xids.contains(xid)) { // This Xid is going to be recovered by the AtomicAction // it is possible that the Xid is recovered by both txbridge and XATerminator - the second // would get noxaresource error message xids.remove(xid); return theKey; } } } return null; }
private XAResource getTheKey(Xid xid) { if (_xidScans != null) { Enumeration<XAResource> keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = keys.nextElement(); RecoveryXids xids = _xidScans.get(theKey); // JBTM-1255 moved stale check back to bottomUpRecovery if (xids.contains(xid)) { // This Xid is going to be recovered by the AtomicAction // it is possible that the Xid is recovered by both txbridge and XATerminator - the second // would get noxaresource error message xids.remove(xid); return theKey; } } } return null; }
private XAResource getTheKey(Xid xid) { if (_xidScans != null) { Enumeration<XAResource> keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = keys.nextElement(); RecoveryXids xids = _xidScans.get(theKey); // JBTM-1255 moved stale check back to bottomUpRecovery if (xids.contains(xid)) { // This Xid is going to be recovered by the AtomicAction // it is possible that the Xid is recovered by both txbridge and XATerminator - the second // would get noxaresource error message xids.remove(xid); return theKey; } } } return null; }
private XAResource getTheKey(Xid xid) { if (_xidScans != null) { Enumeration<XAResource> keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = keys.nextElement(); RecoveryXids xids = _xidScans.get(theKey); // JBTM-1255 moved stale check back to bottomUpRecovery if (xids.contains(xid)) { // This Xid is going to be recovered by the AtomicAction // it is possible that the Xid is recovered by both txbridge and XATerminator - the second // would get noxaresource error message xids.remove(xid); return theKey; } } } return null; }
/** * @param xid The transaction to commit/rollback. * * @return the XAResource than can be used to commit/rollback the specified * transaction. */ private XAResource getNewXAResource(Xid xid) { if (_xidScans == null) { bottomUpRecovery(); } if (_xidScans != null) { Enumeration<XAResource> keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = keys.nextElement(); RecoveryXids xids = _xidScans.get(theKey); // JBTM-1255 moved stale check back to bottomUpRecovery if (xids.contains(xid)) return theKey; } } return null; }
/** * If supplied xids contains any values seen on prev scans, replace the existing * XAResource with the supplied one and return true. Otherwise, return false. * * @param xaResource * @param xids * @return */ public boolean updateIfEquivalentRM(XAResource xaResource, Xid[] xids) { if(xids != null && xids.length > 0) { for(int i = 0; i < xids.length; i++) { if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis(); return true; } } } // either (or both) passes have an empty Xid set, // so fallback to isSameRM as we can't use Xid matching if(isSameRM(xaResource)) { _xares = xaResource; _lastValidated = System.currentTimeMillis(); return true; } return false; }
if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
if(contains(xids[i])) { _xares = xaResource; _lastValidated = System.currentTimeMillis();
/** * @param Xid * xid The transaction to commit/rollback. * * @return the XAResource than can be used to commit/rollback the specified * transaction. */ public XAResource getNewXAResource(Xid xid) { if (_xidScans == null) { resourceInitiatedRecovery(); resourceInitiatedRecoveryForRecoveryHelpers(); } if (_xidScans != null) { Enumeration keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = (XAResource) keys.nextElement(); RecoveryXids xids = (RecoveryXids) _xidScans.get(theKey); if (xids.contains(xid)) return theKey; } } return null; }
/** * @param xid The transaction to commit/rollback. * * @return the XAResource than can be used to commit/rollback the specified * transaction. */ private XAResource getNewXAResource(Xid xid) { // JBTM-1354 JCA needs to be able to recover XAResources associated with a subordinate transaction so we have to do at least // the start scan to make sure that we have loaded all the XAResources we possibly can to assist subordinate transactions recovering // the reason we can't do bottom up recovery is if this server has an XAResource which tries to recover a remote server (e.g. distributed JTA) // then we get deadlock on the secondpass periodicWorkFirstPass(); if (_xidScans != null) { Enumeration<XAResource> keys = _xidScans.keys(); while (keys.hasMoreElements()) { XAResource theKey = keys.nextElement(); RecoveryXids xids = _xidScans.get(theKey); // JBTM-1255 moved stale check back to bottomUpRecovery if (xids.contains(xid)) { // This Xid is going to be recovered by the AtomicAction xids.remove(xid); return theKey; } } } return null; }
assertTrue( trans[0].equals(xids[1]) || trans[1].equals(xids[1])); assertTrue(rxids.contains(xids[0]));