Package com.arjuna.ats.arjuna

Examples of com.arjuna.ats.arjuna.AtomicAction


      return ids;
   }

   public int getStatus(Uid uid)
   {
      AtomicAction action = new AtomicAction(uid);

      action.activate();

      return action.status();
   }
View Full Code Here


    {
        TransactionImple theTransaction = (TransactionImple) which;

        try
        {
            AtomicAction act = ((theTransaction == null) ? null : theTransaction.getAtomicAction());
           
            if (!AtomicAction.resume(act))
                throw new InvalidTransactionException();

            theTransaction = null;
View Full Code Here

    {
  if (xids == null)
  {
      xids = new Xid[2];

      AtomicAction a = new AtomicAction();
 
      xids[0] = new XidImple(a);

      byte[] c = com.arjuna.ats.arjuna.coordinator.TxControl.getXANodeName();
 
View Full Code Here

            if ((args[i].compareTo("-crash") == 0))
                crash = true;
        }

        // Create a new JBoss transaction
        AtomicAction tx = new AtomicAction();
        // Allocate space to monitor the transaction, this variable is overriden each time the transaction is used.
        int actionStatus = tx.begin(); // Top level begin

        // If the transaction was successful began
        if (actionStatus == ActionStatus.RUNNING)
        {
            // Enlist the participant
            int addOutcome = tx.add(new SimpleRecord(crash));
            // If the participant was succesfully added to the intentions list
            if (addOutcome == AddOutcome.AR_ADDED)
            {
                System.out.println("About to complete the transaction ");
                // Try to complete the transaction as requested by the user
                if (commit)
                    actionStatus = tx.commit()// Top level commit
                else
                    actionStatus = tx.abort()// Top level rollback

                System.out.println("The status of the transaction is " + ActionStatus.stringForm(actionStatus));
            }
            else
            {
View Full Code Here

        return com.arjuna.ats.jta.TransactionManager.transactionManager().getTransaction();
    }

    public int begin()
    {
        this.tx = new AtomicAction();
       
        return tx.begin();
    }
View Full Code Here

  System.runFinalization();
    }

private void test () throws Exception
    {
  AtomicAction A = new AtomicAction();

  A.begin();

  A = null;

  System.gc();
    }
View Full Code Here

  {
    for (int i = 0; i < _iters; i++)
    {
      try
      {
        AtomicAction A = new AtomicAction();

        A.begin();

        A.add(new BasicRecord());

        A.commit();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

    InputObjectState ios = new InputObjectState();
    boolean passed = false;
   
    try
    {
      TxControl.getStore().allObjUids(new AtomicAction().type(), ios, ObjectStore.OS_UNKNOWN);
     
      Uid tempUid = new Uid(Uid.nullUid());

      tempUid.unpack(ios);
     
View Full Code Here

   
    do
    {
      try
      {
        AtomicAction A = new AtomicAction();
       
        A.begin();
       
        A.add(new BasicRecord());
       
        A.commit();
      }
      catch (final Exception ex)
      {
      }
     
View Full Code Here

private void test () throws Exception
    {
  for (int i = 0; i < 100; i++)
  {
      AtomicAction A = new AtomicAction();

      A.begin();

      BasicObject bo = new BasicObject();

      bo.set(2);

      A.commit();

      AtomicAction B = new AtomicAction();

      B.begin();

      bo.destroy();

      B.abort();

      AtomicAction C = new AtomicAction();

      C.begin();

      bo.destroy();

      C.commit();
  }
    }
View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.AtomicAction

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.