Package javax.transaction.xa

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


  
         TextMessage tm3 = sess2.createTextMessage("testing3");
  
         prod3.send(tm3);
  
         res2.end(xid2, XAResource.TMSUCCESS);
  
         //prepare both txs
  
  
         res1.prepare(xid1);
View Full Code Here


           
            res.start(xid1, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid1, XAResource.TMSUCCESS);
           
            res.prepare(xid1);
        
         }
        
View Full Code Here

           
            res.start(xid2, XAResource.TMNOFLAGS);
           
            prod.send(tm);
           
            res.end(xid2, XAResource.TMSUCCESS);
           
            res.prepare(xid2);
        
         }
        
View Full Code Here

         // Do some work
         publisher.publish(message);

         // Suspend the transaction
         resource.end(xid1, XAResource.TMSUSPEND);

         // Add the xa resource to xid2
         MyXid xid2 = new MyXid();
         resource.start(xid2, XAResource.TMNOFLAGS);
View Full Code Here

         // 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);
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();
View Full Code Here

         Message message = session.createTextMessage();

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

         message = subscriber.receive(1000);
         if (message == null)
            fail("No message?");

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

         resource.start(xid1, XAResource.TMNOFLAGS);
         // 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
      {
View Full Code Here

         TextMessage tm1 = sess1.createTextMessage("testing1");

         prod1.send(tm1);

         res1.end(trailing, XAResource.TMSUCCESS);

         res1.prepare(trailing);

         // Now "crash" the server
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.