/** * @param xaResourceRecord The record to reassociate. * * @return the XAResource than can be used to commit/rollback the specified * record. */ public XAResource getNewXAResource(XAResourceRecord xaResourceRecord) { return getNewXAResource(xaResourceRecord.getXid()); }
/** * @param xaResourceRecord The record to reassociate. * * @return the XAResource than can be used to commit/rollback the specified * record. */ public XAResource getNewXAResource(XAResourceRecord xaResourceRecord) { return getNewXAResource(xaResourceRecord.getXid()); }
/** * @param xaResourceRecord The record to reassociate. * * @return the XAResource than can be used to commit/rollback the specified * record. */ public XAResource getNewXAResource(XAResourceRecord xaResourceRecord) { return getNewXAResource(xaResourceRecord.getXid()); }
/** * @param xaResourceRecord The record to reassociate. * * @return the XAResource than can be used to commit/rollback the specified * record. */ public XAResource getNewXAResource(XAResourceRecord xaResourceRecord) { return getNewXAResource(xaResourceRecord.getXid()); }
/** * @param xaResourceRecord The record to reassociate. * * @return the XAResource than can be used to commit/rollback the specified * record. */ public XAResource getNewXAResource(XAResourceRecord xaResourceRecord) { return getNewXAResource(xaResourceRecord.getXid()); }
/** * @param xaResourceRecord The record to reassociate. * * @return the XAResource than can be used to commit/rollback the specified * record. */ public XAResource getNewXAResource(XAResourceRecord xaResourceRecord) { return getNewXAResource(xaResourceRecord.getXid()); }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(this); } } } return null; }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(this); } } } return null; }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(this); } } } return null; }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(this); } } } return null; }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(this); } } } return null; }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(_tranID); } } } return null; }
/** * This routine finds the new XAResource for the transaction that used the * old resource we couldn't serialize. It does this by looking up the * XARecoveryModule in the recovery manager and asking it for the * XAResource. The recovery manager will then look through its list of * registered XARecoveryResource implementations for the appropriate * instance. If the XARecoveryModule hasn't been initialised yet then this * routine will fail, but on the next scan it should work. */ private final XAResource getNewXAResource() { RecoveryManager recMan = RecoveryManager.manager(); Vector recoveryModules = recMan.getModules(); if (recoveryModules != null) { Enumeration modules = recoveryModules.elements(); while (modules.hasMoreElements()) { RecoveryModule m = (RecoveryModule) modules.nextElement(); if (m instanceof XARecoveryModule) { /* * Blaargh! There are better ways to do this! */ return ((XARecoveryModule) m).getNewXAResource(this); } } } return null; }
@Test public void testRecover () throws Exception { ArrayList<String> r = new ArrayList<String>(); TransactionImple tx = new TransactionImple(0); assertTrue(tx.enlistResource(new RecoveryXAResource())); assertEquals(tx.doPrepare(), TwoPhaseOutcome.PREPARE_OK); r.add("com.hp.mwtests.ts.jta.recovery.DummyXARecoveryResource"); jtaPropertyManager.getJTAEnvironmentBean().setXaResourceRecoveryClassNames(r); XARecoveryModule xarm = new XARecoveryModule(); assertNull(xarm.getNewXAResource( new XAResourceRecord(null, null, new XidImple(), null) )); for (int i = 0; i < 11; i++) { xarm.periodicWorkFirstPass(); xarm.periodicWorkSecondPass(); } assertTrue(xarm.getNewXAResource( new XAResourceRecord(null, null, new XidImple(new Uid()), null) ) == null); assertNull(xarm.getNewXAResource( new XAResourceRecord(null, null, new XidImple(), null) )); }
xarm.getNewXAResource( new XAResourceRecord(null, null, new XidImple(), null) );