Examples of DemoDurableParticipant


Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p, null);
     
      ut.commit();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_COMMIT, FailureParticipant.WRONG_STATE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.WRONG_STATE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_ROLLBACK, FailureParticipant.WRONG_STATE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

 
  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();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
      tm.enlistForDurableTwoPhase(p3, null);
      tm.enlistForDurableTwoPhase(p4, null);
     
      ut.commit();

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

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p, null);

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

      tm.resume(ctx);

      System.out.println("\nResumed\n");

      ut.commit();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.NONE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p = new DemoDurableParticipant();
      DemoVolatileParticipant pz = new DemoVolatileParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p, null);
      tm.enlistForVolatileTwoPhase(pz, null);
     
      ut.commit();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoDurableParticipant

 
  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)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.wst.tests.common.DemoDurableParticipant

    public static void testSingleParticipant()
            throws Exception
    {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p = new DemoDurableParticipant();
     
      ut.begin();
      try {
      tm.enlistForDurableTwoPhase(p, p.identifier());
        catch (Exception eouter) {
            try {
                ut.rollback();
            } catch(Exception einner) {
            }
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.