Package javax.transaction.xa

Examples of javax.transaction.xa.Xid


      locatorTimeout.setCallTimeout(300);
      ClientSessionFactory factoryTimeout = locatorTimeout.createSessionFactory();

      final ClientSession sessionTimeout  = factoryTimeout.createSession(true, false, false);
     
      Xid xid = newXID();

      try
      {
         sessionTimeout.start(xid, XAResource.TMNOFLAGS);
      }
View Full Code Here


      }
      if (!(other instanceof Xid))
      {
         return false;
      }
      Xid xother = (Xid)other;
      if (xother.getFormatId() != formatId)
      {
         return false;
      }
      if (xother.getBranchQualifier().length != branchQualifier.length)
      {
         return false;
      }
      if (xother.getGlobalTransactionId().length != globalTransactionId.length)
      {
         return false;
      }
      for (int i = 0; i < branchQualifier.length; i++)
      {
         byte[] otherBQ = xother.getBranchQualifier();
         if (branchQualifier[i] != otherBQ[i])
         {
            return false;
         }
      }
      for (int i = 0; i < globalTransactionId.length; i++)
      {
         byte[] otherGtx = xother.getGlobalTransactionId();
         if (globalTransactionId[i] != otherGtx[i])
         {
            return false;
         }
      }
View Full Code Here

     * MockControl.ONE_OR_MORE); final SessionHolderProviderManager
     * providerManager = new ListSessionHolderProviderManager();
     *
     */

    Xid xidMock = new XidMock();

    xaRes.start(xidMock, XAResource.TMNOFLAGS);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.prepare(xidMock);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
View Full Code Here

     *
     * sessionControl.expectAndReturn(session.getRepository(), repository,
     * MockControl.ONE_OR_MORE);
     */

    Xid xidMock = new XidMock();

    xaRes.start(xidMock, XAResource.TMNOFLAGS);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.end(xidMock, XAResource.TMFAIL);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
View Full Code Here

    sessionControl.expectAndReturn(session.getXAResource(), xaRes);
    session.save();
    session.logout();

    Xid xidMock = new XidMock();

    xaRes.start(xidMock, XAResource.TMNOFLAGS);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.end(xidMock, XAResource.TMFAIL);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
View Full Code Here

      // recover prepared transactions
      for (PreparedTransactionInfo preparedTransaction : preparedTransactions)
      {
         XidEncoding encodingXid = new XidEncoding(preparedTransaction.extraData);

         Xid xid = encodingXid.xid;

         Transaction tx = new TransactionImpl(preparedTransaction.id, xid, this);

         List<MessageReference> referencesToAck = new ArrayList<MessageReference>();
View Full Code Here

         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
         res1.start(xid, XAResource.TMNOFLAGS);
         res1.end(xid, XAResource.TMSUCCESS);
         int rmAfter = rm.size();
         assertTrue(rmSizeBeforeStart + 1 == rmAfter);
         res1.start(xid, XAResource.TMJOIN);
View Full Code Here

         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
         res1.start(xid, XAResource.TMNOFLAGS);
         res1.end(xid, XAResource.TMSUCCESS);
         int rmAfter = rm.size();
         assertTrue(rmSizeBeforeStart + 1 == rmAfter);
         res1.start(xid, XAResource.TMJOIN);
View Full Code Here

         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
         res1.start(xid, XAResource.TMNOFLAGS);
         res1.end(xid, XAResource.TMSUCCESS);
         int rmAfter = rm.size();
         assertTrue(rmSizeBeforeStart + 1 == rmAfter);
         res1.start(xid, XAResource.TMRESUME);
View Full Code Here

         XASession sess1 = conn.createXASession();
         MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
         byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
         byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
         int rmSizeBeforeStart = rm.size();
         Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
         res1.start(xid, XAResource.TMNOFLAGS);
         res1.end(xid, XAResource.TMSUCCESS);
         int rmAfter = rm.size();
         assertTrue(rmSizeBeforeStart + 1 == rmAfter);
         res1.start(xid, XAResource.TMRESUME);
View Full Code Here

TOP

Related Classes of javax.transaction.xa.Xid

Copyright © 2018 www.massapicom. 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.