Package com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.TransactionImple.doPrepare()


      TransactionImple tx = TxImporter.getImportedTransaction(xid);
     
      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);
     
      switch (tx.doPrepare())
      {
      case TwoPhaseOutcome.PREPARE_READONLY:
        TxImporter.removeImportedTransaction(xid);
       
        return XAResource.XA_RDONLY;       
View Full Code Here


      TransactionImple tx = TxImporter.getImportedTransaction(xid);

      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);

      switch (tx.doPrepare())
      {
      case TwoPhaseOutcome.PREPARE_READONLY:
        TxImporter.removeImportedTransaction(xid);
        return XAResource.XA_RDONLY;
      case TwoPhaseOutcome.PREPARE_NOTOK:
View Full Code Here

  {
    for (int i = 0; i < 1000; i++)
    {
      final TransactionImple tm = new TransactionImple(0); // implicit begin

      tm.doPrepare();
      tm.doCommit();
    }

    assertEquals(ActionManager.manager().inflightTransactions().size(), 0);
  }
View Full Code Here

  {
    for (int i = 0; i < 1000; i++)
    {
      final TransactionImple tm = new TransactionImple(0); // implicit begin

      tm.doPrepare();
      tm.doRollback();
    }

    assertEquals(ActionManager.manager().inflightTransactions().size(), 0);
  }
View Full Code Here

    public void testTwoPhaseCommitSync() throws Exception
    {
        final TransactionImple tm = new TransactionImple(0);
        final TestSynchronization sync = new TestSynchronization();
        tm.registerSynchronization(sync);
        assertEquals(TwoPhaseOutcome.PREPARE_READONLY, tm.doPrepare());
        tm.doCommit();
        assertTrue(sync.isBeforeCompletionDone());
        assertTrue(sync.isAfterCompletionDone());
        assertEquals(javax.transaction.Status.STATUS_COMMITTED, tm.getStatus());
    }
View Full Code Here

        final TestSynchronization sync = new TestSynchronization();
        tm.registerSynchronization(sync);
        final TestXAResource xaResource = new TestXAResource();
        xaResource.setPrepareReturnValue(XAResource.XA_OK);
        tm.enlistResource(xaResource);
        assertEquals(TwoPhaseOutcome.PREPARE_OK, tm.doPrepare());
        tm.doCommit();
        assertTrue(sync.isBeforeCompletionDone());
        assertTrue(sync.isAfterCompletionDone());
        assertEquals(javax.transaction.Status.STATUS_COMMITTED, tm.getStatus());
    }
View Full Code Here

    {
        final TransactionImple tm = new TransactionImple(0);
        final TestSynchronization sync = new TestSynchronization();
        tm.registerSynchronization(sync);
        tm.setRollbackOnly();
        assertEquals(TwoPhaseOutcome.PREPARE_NOTOK, tm.doPrepare());
        tm.doRollback();
        assertFalse(sync.isBeforeCompletionDone());
        assertTrue(sync.isAfterCompletionDone());
        assertEquals(javax.transaction.Status.STATUS_ROLLEDBACK, tm.getStatus());
    }
View Full Code Here

      TransactionImple tx = TxImporter.getImportedTransaction(xid);

      if (tx == null)
        throw new XAException(XAException.XAER_INVAL);

      switch (tx.doPrepare())
      {
      case TwoPhaseOutcome.PREPARE_READONLY:
        TxImporter.removeImportedTransaction(xid);
        return XAResource.XA_RDONLY;
      case TwoPhaseOutcome.PREPARE_NOTOK:
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.