Package com.arjuna.mw.wst

Examples of com.arjuna.mw.wst.UserTransaction


    {
  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p1 = new DemoDurableParticipant();
      DemoDurableParticipant p2 = new DemoDurableParticipant();
      DemoDurableParticipant p3 = new DemoDurableParticipant();
      DemoDurableParticipant p4 = new DemoDurableParticipant();

      System.out.println("Starting first transaction.\n");
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
      tm.enlistForDurableTwoPhase(p3, null);
      tm.enlistForDurableTwoPhase(p4, null);

      TxContext ctx = tm.suspend();
     
      System.out.println("Suspended: "+ctx);

      ut.begin();
     
      System.out.println("\nStarted second transaction.");
     
      tm.resume(ctx);
     
      System.out.println("\nCommitting first transaction.\n");
     
      ut.commit();

      passed = p1.passed() && p2.passed() && p3.passed() && p4.passed();
  }
  catch (Exception ex)
  {
View Full Code Here


    {
  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
 
      // nesting not supported, so each is a separate top-level tx.

      ut.begin();
     
      ut.begin();
     
      ut.commit();

      ut.commit();
  }
  catch (com.arjuna.wst.UnknownTransactionException ex)
  {
      passed = true;
  }
View Full Code Here

TOP

Related Classes of com.arjuna.mw.wst.UserTransaction

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.