Examples of doPrepare()


Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

        // first associate the tx on this thread, by resuming the tx
        this.resumeTransaction(subordinateTransaction);
        try {
            // now "prepare"
            // Courtesy: com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple
            int result = subordinateTransaction.doPrepare();
            switch (result) {
                case TwoPhaseOutcome.PREPARE_READONLY:
                    // TODO: Would it be fine to not remove the xid? (Need to understand how the subsequent
                    // flow works)
                    SubordinationManager.getTransactionImporter().removeImportedTransaction(this.xidTransactionID.getXid());
View Full Code Here

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

        try {
            // now "prepare"
            final Xid xid = this.xidTransactionID.getXid();
            // Courtesy: com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple
            final SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
            int result = subordinateTransaction.doPrepare();
            switch (result) {
                case TwoPhaseOutcome.PREPARE_READONLY:
                    // TODO: Would it be fine to not remove the xid? (Need to understand how the subsequent
                    // flow works)
                    SubordinationManager.getTransactionImporter().removeImportedTransaction(xid);
View Full Code Here

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

        // first associate the tx on this thread, by resuming the tx
        this.resumeTransaction(subordinateTransaction);
        try {
            // now "prepare"
            // Courtesy: com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple
            int result = subordinateTransaction.doPrepare();
            switch (result) {
                case TwoPhaseOutcome.PREPARE_READONLY:
                    // TODO: Would it be fine to not remove the xid? (Need to understand how the subsequent
                    // flow works)
                    SubordinationManager.getTransactionImporter().removeImportedTransaction(this.xidTransactionID.getXid());
View Full Code Here

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

        try {
            // now "prepare"
            final Xid xid = this.xidTransactionID.getXid();
            // Courtesy: com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple
            final SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
            int result = subordinateTransaction.doPrepare();
            switch (result) {
                case TwoPhaseOutcome.PREPARE_READONLY:
                    // TODO: Would it be fine to not remove the xid? (Need to understand how the subsequent
                    // flow works)
                    SubordinationManager.getTransactionImporter().removeImportedTransaction(xid);
View Full Code Here

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

        try {
            // now "prepare"
            final Xid xid = this.xidTransactionID.getXid();
            // Courtesy: com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple
            final SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
            int result = subordinateTransaction.doPrepare();
            switch (result) {
                case TwoPhaseOutcome.PREPARE_READONLY:
                    // TODO: Would it be fine to not remove the xid? (Need to understand how the subsequent
                    // flow works)
                    SubordinationManager.getTransactionImporter().removeImportedTransaction(xid);
View Full Code Here

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

      SubordinateTransaction tx = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);

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

      switch (tx.doPrepare())
      {
      case TwoPhaseOutcome.PREPARE_READONLY:
        SubordinationManager.getTransactionImporter().removeImportedTransaction(xid);

        return XAResource.XA_RDONLY;
View Full Code Here

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

  {
    for (int i = 0; i < 1000; i++)
    {
      final SubordinateTransaction tm = createTransaction();

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

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

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

  {
    for (int i = 0; i < 1000; i++)
    {
      final SubordinateTransaction tm = createTransaction();

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

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

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

    public void testTwoPhaseCommitSync() throws Exception
    {
        final SubordinateTransaction tm = createTransaction();
        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

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction.doPrepare()

        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
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.