Package com.arjuna.mw.wst

Examples of com.arjuna.mw.wst.TransactionManager


  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
 
      ut.begin();
     
      TxContext ctx = tm.suspend();

      System.out.println("Suspended: "+ctx);
     
      tm.resume(ctx);

      System.out.println("\nResumed");
     
      ut.commit();
View Full Code Here


        {
            /*
             * There should either be an Atomic Transaction *or* a Business Activity
             * associated with the thread.
             */
            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;

            final Context atContext ;
            if (transactionManager != null)
            {
                final com.arjuna.mwlabs.wst.at.context.TxContextImple txContext =
                    (com.arjuna.mwlabs.wst.at.context.TxContextImple)transactionManager.currentTransaction() ;
                atContext = (txContext == null ? null : txContext.context()) ;
            }
            else
            {
                atContext = null ;
View Full Code Here

  boolean passed = false;
 
  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);
     
      ut.commit();

      passed = false;
  }
View Full Code Here

        {
            /*
             * There should either be an Atomic Transaction *or* a Business Activity
             * associated with the thread.
             */
            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;

            final Context atContext ;
            if (transactionManager != null)
            {
                final com.arjuna.mwlabs.wst.at.context.TxContextImple txContext =
                    (com.arjuna.mwlabs.wst.at.context.TxContextImple)transactionManager.currentTransaction() ;
                atContext = (txContext == null ? null : txContext.context()) ;
            }
            else
            {
                atContext = null ;
View Full Code Here

  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
 
      ut.begin();
     
      TxContext ctx = tm.suspend();

      System.out.println("Suspended: "+ctx);
     
      ut.commit();
  }
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      TransactionManager ut = TransactionManager.getTransactionManager();
 
      ut.resume(null);

      passed = true;
  }
  catch (Exception ex)
  {
View Full Code Here

  boolean passed = false;
 
  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();
  }
View Full Code Here

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

TOP

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

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.