Package javax.transaction.xa

Examples of javax.transaction.xa.XAResource.prepare()


         // Publish a message using "AutoAcknowledge"
         publisher.publish(message);

         resource.end(xid1, XAResource.TMSUCCESS);
         resource.prepare(xid1);
         // JBossMessaging only sends the message when a commit is done, while JBossMQ would send messages to consumers on the same session,
         // doing something differently on the transaction isolation.
         // Because of that this commit is necessary to complete this testcase.
         resource.commit(xid1, false);
View Full Code Here


         if (message == null)
            fail("No message?");

         // Prepare the transaction
         resource.end(xid1, XAResource.TMSUCCESS);
         resource.prepare(xid1);
        
         // Rollback
         resource.rollback(xid1);

         xid1 = new MyXid();
View Full Code Here

                    Object key = branchKeys.next();
                    XAResource resourceManager = (XAResource) branches.get(key);
                    try
                    {
                        // Preparing the resource manager using its branch xid
                        resourceManager.prepare((Xid) key);
                    }
                    catch (Throwable e)
                    {
                        if( failures == null )
                        {
View Full Code Here

                    Xid key = branchKeys.next();
                    XAResource resourceManager = branches.get(key);
                    try
                    {
                        // Preparing the resource manager using its branch xid
                        resourceManager.prepare(key);
                    }
                    catch (Throwable e)
                    {
                        if (failures == null)
                        {
View Full Code Here

         prod1.send(tm1);

         res1.end(trailing, XAResource.TMSUCCESS);

         res1.prepare(trailing);

         // Now "crash" the server

         ServerManagement.stopServerPeer();
View Full Code Here

   public int prepare(Xid xid) throws XAException
   {
      XAResource xaResource = getDelegate();
      try
      {
         return xaResource.prepare(xid);
      }
      catch (XAException e)
      {
         throw check(e);
      }
View Full Code Here

    Xid xidMock = new XidMock();

    xaRes.start(xidMock, XAResource.TMNOFLAGS);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.prepare(xidMock);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaResControl.setReturnValue(0);
    xaRes.commit(xidMock, false);
    xaResControl.setMatcher(MockControl.ALWAYS_MATCHER);
    xaRes.end(xidMock, XAResource.TMSUCCESS);
View Full Code Here

            XATestUtil.showXATransactionView(conn);

            // this prepare won't work since
            // transaction 1 has been suspended - XA_PROTO
            try {
                xar.prepare(xid1);
                System.out.println("FAIL - prepare on suspended transaction");
            } catch (XAException e) {
                if (e.errorCode != XAException.XAER_PROTO)
                    XATestUtil.dumpXAException(
                            "FAIL - prepare on suspended transaction", e);
View Full Code Here

            xar.end(xid2, XAResource.TMSUCCESS);

            xar.end(xid1, XAResource.TMSUCCESS);

            xar.prepare(xid1);
            xar.prepare(xid2);

            // both should be prepared.
            XATestUtil.showXATransactionView(conn);
View Full Code Here

            xar.end(xid2, XAResource.TMSUCCESS);

            xar.end(xid1, XAResource.TMSUCCESS);

            xar.prepare(xid1);
            xar.prepare(xid2);

            // both should be prepared.
            XATestUtil.showXATransactionView(conn);

            Xid[] recoveredStart = xar.recover(XAResource.TMSTARTRSCAN);
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.