Package com.arjuna.ats.arjuna

Examples of com.arjuna.ats.arjuna.AtomicAction


    System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
    System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
    System.setProperty(Environment.TRANSACTION_LOG_SYNC_REMOVAL, "true");
    System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000")// essentially infinite
   
    AtomicAction A = new AtomicAction();
    Uid txId = A.get_uid();
   
    System.err.println("IMPORTANT: if there are warnings about USER_DEF_FIRST0 then the test has failed!");
   
    A.begin();

    A.add(new BasicRecord());

    A.commit();
   
    RecoverAtomicAction rAA = new RecoverAtomicAction(txId, ActionStatus.COMMITTED);
   
    rAA.replayPhase2();
  }
View Full Code Here


            _tests_passed = 0;
            _tests_failed = 0;

            _test_service = new ActionStatusService();

            _transaction_1 = new AtomicAction();
            _transaction_2 = new AtomicAction();
            _transaction_3 = new AtomicAction();

            _test_tran_type_1 = _transaction_1.type();
            _test_tran_type_2 = _transaction_2.type();
            _test_tran_type_3 = _transaction_3.type();
View Full Code Here

    System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
    System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
    System.setProperty(Environment.TRANSACTION_LOG_SYNC_REMOVAL, "false");
    System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000")// essentially infinite
   
    AtomicAction A = new AtomicAction();
    Uid txId = A.get_uid();
   
    System.err.println("IMPORTANT: ignore warnings about USER_DEF_FIRST0 as they are expected due to BasicRecord usage!");
   
    A.begin();

    A.add(new BasicRecord());

    A.commit();
   
    RecoverAtomicAction rAA = new RecoverAtomicAction(txId, ActionStatus.COMMITTED);
   
    rAA.replayPhase2();
  }
View Full Code Here

  int numberOfTransactions = 1000;
  long stime = Calendar.getInstance().getTime().getTime();

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

      A.begin();
      A.abort();
  }

  long ftime = Calendar.getInstance().getTime().getTime();
  long timeTaken = ftime - stime;
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

public void run ()
    {
  if (startAction)
  {
      BasicThreadedObject.A = new AtomicAction();

      System.out.println("BasicThreadedObject "+uid+" created action "+BasicThreadedObject.A.get_uid());

      BasicThreadedObject.A.begin();
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

public void run(String[] args)
    {
        try
        {
            AtomicAction A = new AtomicAction();
            AtomicAction B = new AtomicAction();

            logInformation("Starting top-level action.");

            A.begin();

            logInformation(A.toString());

            logInformation("Starting nested action.");

            B.begin();

            logInformation(B.toString());

            logInformation("Committing top-level action. This should fail.");

            A.commit();

            logInformation("Committing nested action. This should fail.");

            B.commit();

            BasicAction current = BasicAction.Current();

            logInformation("Current action is " + current);
View Full Code Here

    public void run (String[] args)
    {
        try
        {
      boolean success = false;
            AtomicAction A = new AtomicAction();
      OnePhase opRes = new OnePhase();

      System.err.println("Starting top-level action.");

            A.begin();

      A.add(new LastResourceRecord(opRes));
      A.add(new ShutdownRecord(ShutdownRecord.FAIL_IN_PREPARE));

      A.commit();

      if (opRes.status() != OnePhase.COMMITTED)
      {
    System.err.println("Confirmed that one-phase record is last in prepare.");

    A = new AtomicAction();
    opRes = new OnePhase();

    A.begin();

    System.err.println("\nStarting new top-level action.");

    A.add(new LastResourceRecord(opRes));
    A.add(new ShutdownRecord(ShutdownRecord.FAIL_IN_COMMIT));

    A.commit();

    if (opRes.status() == OnePhase.COMMITTED)
    {
        System.err.println("Confirmed that one-phase record is first in commit.");

        A = new AtomicAction();

        A.begin();

        A.add(new LastResourceRecord(new OnePhase()));

        if (A.add(new LastResourceRecord(new OnePhase())) == AddOutcome.AR_DUPLICATE)
        {
      System.err.println("\nConfirmed that only one such resource can be added.");

      assertSuccess();
        }
View Full Code Here

    {
        ObjectStore os = TxControl.getStore();
        OutputObjectState fluff = new OutputObjectState();
        Uid kungfuTx = new Uid();
        boolean outcome = false;
        final String tn = new AtomicAction().type();

        try
        {
            kungfuTx.pack(fluff);
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.