Package javax.transaction.xa

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


         // Do some work in the new transaction
         publisher.publish(message);

         // Commit the first transaction and end the branch
         resource.end(xid1, XAResource.TMSUCCESS);
         resource.commit(xid1, true);

         // Do some more work in the new transaction
         publisher.publish(message);

         // Commit the second transaction and end the branch
View Full Code Here


         // Do some more work in the new transaction
         publisher.publish(message);

         // Commit the second transaction and end the branch
         resource.end(xid2, XAResource.TMSUCCESS);
         resource.commit(xid2, true);
      }
      catch(Exception e)
      {
         e.printStackTrace();
         throw e;
View Full Code Here

         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);

         xid1 = new MyXid();
         resource.start(xid1, XAResource.TMNOFLAGS);

         // Receive the message
View Full Code Here

         // Receive the message using "AutoAcknowledge"
         message = subscriber.receiveNoWait();
         if (message == null)
            fail("No message after rollback?");
         resource.end(xid1, XAResource.TMSUCCESS);
         resource.commit(xid1, true);

      }
      finally
      {
         connection.close();
View Full Code Here

                    XAResource resourceManager = (XAResource) branches.get(key);
                    try
                    {
                        if (!failed)
                        {
                            resourceManager.commit(xid, true);
                        }
                        else
                        {
                            resourceManager.rollback(xid);
                        }
View Full Code Here

                    {
                        Object key = branchKeys.next();
                        XAResource resourceManager = (XAResource) branches.get(key);
                        try
                        {
                            resourceManager.commit((Xid) key, false);
                        }
                        catch (Throwable e)
                        {
                            JPOXLogger.TRANSACTION.error(LOCALISER.msg("015038", "commit", resourceManager, getXAErrorCode(e), toString()));                    
                            if( failures == null )
View Full Code Here

                    XAResource resourceManager = branches.get(key);
                    try
                    {
                        if (!failed)
                        {
                            resourceManager.commit(key, true);
                        }
                        else
                        {
                            resourceManager.rollback(key);
                        }
View Full Code Here

                    {
                        Xid key = branchKeys.next();
                        XAResource resourceManager = branches.get(key);
                        try
                        {
                            resourceManager.commit(key, false);
                        }
                        catch (Throwable e)
                        {
                            NucleusLogger.TRANSACTION.error(LOCALISER.msg("015038", "commit", resourceManager,
                                getXAErrorCode(e), toString()));                    
View Full Code Here

         assertEqualByteArrays(trailing.getGlobalTransactionId(), trailing2.getGlobalTransactionId());

         assertEqualByteArrays(trailing.getBranchQualifier(), trailing2.getBranchQualifier());

         res.commit(trailing, false);
      }
      finally
      {
         removeAllMessages(queue1.getQueueName(), true, 0);
View Full Code Here

   {
      log.debug("Commit " + providerName + " xid " + " onePhase=" + onePhase);
      XAResource xaResource = getDelegate();
      try
      {
         xaResource.commit(xid, onePhase);
      }
      catch (XAException e)
      {
         throw check(e);
      }
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.