public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction(Uid id) { try { if (id != null) return (TransactionImple) _transactions.get(id); else return null; } catch (Exception e) { return new TransactionImple(null); } }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
public static final TransactionImple getTransaction() { TransactionImple tx = null; final BasicAction current = BasicAction.Current(); if (current != null) { final Uid txid = current.get_uid(); tx = (TransactionImple) _transactions.get(txid); if (tx == null) tx = new TransactionImple(current); } return tx; }
/** * Test that resources that generate heuristics are instrumented correctly * @throws Exception */ @Test public void testMBeanHeuristic () throws Exception { FailureXAResource failureXAResource = new FailureXAResource(FailureXAResource.FailLocation.commit); // generates a heuristic on commit getHeuristicMBean(osb, new TransactionImple(1000000000), failureXAResource); }
@Test public void testReadonly () throws Exception { XAResourceRecord xares; DummyRecoverableXAConnection rc = new DummyRecoverableXAConnection(); Object[] params = new Object[1]; params[XAResourceRecord.XACONNECTION] = rc; xares = new XAResourceRecord(new TransactionImple(0), new TestResource(true), new XidImple(new Uid()), params); assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.NOT_PREPARED); assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_READONLY); }
@Test public void testValid2PC () throws Exception { TransactionImple tx = new TransactionImple(0); DummyXA res = new DummyXA(false); XAResourceRecord xares = new XAResourceRecord(tx, res, tx.getTxId(), null); assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK); assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.FINISH_OK); }
@Test public void test () throws Exception { XAResourceRecord xares = new XAResourceRecord(); Object obj = new Object(); xares.setValue(obj); assertTrue(xares.value() != obj); DummyRecoverableXAConnection rc = new DummyRecoverableXAConnection(); Object[] params = new Object[1]; params[XAResourceRecord.XACONNECTION] = rc; xares = new XAResourceRecord(new TransactionImple(0), new DummyXA(false), new XidImple(new Uid()), params); assertTrue(xares.type() != null); xares.merge(xares); xares.replace(xares); assertTrue(xares.toString() != null); }
@Test public void testCommitFailure () throws Exception { FailureXAResource fxa = new FailureXAResource(FailureXAResource.FailLocation.commit); TransactionImple tx = new TransactionImple(0); XAResourceRecord xares = new XAResourceRecord(tx, fxa, tx.getTxId(), null); assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK); assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.HEURISTIC_MIXED); assertTrue(xares.forgetHeuristic()); }
@Test public void testRollbackFailure () throws Exception { FailureXAResource fxa = new FailureXAResource(FailureXAResource.FailLocation.rollback); TransactionImple tx = new TransactionImple(0); XAResourceRecord xares = new XAResourceRecord(tx, fxa, tx.getTxId(), null); assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK); assertEquals(xares.topLevelAbort(), TwoPhaseOutcome.HEURISTIC_MIXED); assertTrue(xares.forgetHeuristic()); }