Package org.omg.CosTransactions

Examples of org.omg.CosTransactions.Current


      ORBInterface.initORB(args, null);
      OAInterface.initOA();

      boolean correct = true;

      Current current = OTS.get_current();

      current.begin();
      current.commit(true);

      try
      {
        current.commit(true);
        correct = false;
      }
      catch (NoTransaction noTransaction)
      {
      }
View Full Code Here


      boolean correct = true;

      int numberOfTransactionNames = 1000;

      Current current = OTS.get_current();

      String[] transactionNames = new String[numberOfTransactionNames];
      for (int index = 0; index < numberOfTransactionNames; index++)
      {
        current.begin();
        transactionNames[index] = current.get_transaction_name();
        current.rollback();
      }

      for (int index1 = 0; index1 < numberOfTransactionNames - 1; index1++)
      {
        for (int index2 = index1 + 1; index2 < numberOfTransactionNames; index2++)
View Full Code Here

      ORBInterface.initORB(args, null);
      OAInterface.initOA();

      boolean correct = true;

      Current current = OTS.get_current();

      current.begin();
      current.rollback();

      correct = (current.get_status() == Status.StatusNoTransaction);

      if (correct)
      {
        System.out.println("Passed");
      }
View Full Code Here

      ORBInterface.initORB(args, null);
      OAInterface.initOA();

      boolean correct = true;

      Current current = OTS.get_current();

      current.begin();
      current.commit(false);

      Control control = current.suspend();

      correct = (control == null);

      if (correct)
      {
View Full Code Here

      ORBInterface.initORB(args, null);
      OAInterface.initOA();

      boolean correct = true;

      Current current = OTS.get_current();

      try
      {
        current.commit(false);
        correct = false;
      }
      catch (NoTransaction noTransaction)
      {
      }
View Full Code Here

      ORBInterface.initORB(args, null);
      OAInterface.initOA();

      boolean correct = true;

      Current current = OTS.get_current();

      current.begin();
      current.rollback();

      try
      {
        current.rollback_only();
        correct = false;
      }
      catch (NoTransaction noTransaction)
      {
      }
View Full Code Here

            return;
        }

        try
        {
            Current current = OTSManager.get_current();
            System.out.println("Beginning a User transaction to create account");
            current.begin();
            Account acc = _bank.create_account(name);
            System.out.println("Credit the Account");
            acc.credit(fbalance);
            System.out.println("Attempt to commit the account creation transaction");
            current.commit(false);
        }
        catch (Exception e)
        {
            System.err.println("ERROR - " + e);
        }
View Full Code Here

            return;
        }

        try
        {
            Current current = OTSManager.get_current();
            System.out.println("Beginning a User transaction to get balance");
            current.begin();
            try
            {
                Account acc = _bank.get_account(name);
                System.out.println("Balance : " + acc.balance());
            }
            catch (NotExistingAccount nea)
            {
                System.out.println("Account not Found");
                current.rollback_only();
            }

            current.commit(false);
        }
        catch (Exception e)
        {
            System.err.println("ERROR - " + e);
        }
View Full Code Here

        {
            System.out.println("Invalid float number, abort operation...");
            return;
        }

        Current current = null;
        try
        {
            current = OTSManager.get_current();
            System.out.println("Beginning a User transaction to Transfer money");
            current.begin();
            try
            {
                Account supplier = _bank.get_account(name_supplier);
                Account consumer = _bank.get_account(name_consumer);

                supplier.debit(famount);
                consumer.credit(famount);
            }
            catch (NotExistingAccount nea)
            {
                System.out.println("Account not Found");
                current.rollback_only();
            }

            current.commit(false);
        }
        catch (Exception e)
        {
            System.err.println("ERROR - " + e);
        }
View Full Code Here

            return;
        }

        try
        {
            Current current = OTSManager.get_current();
            System.out.println("Beginning a User transaction to create account");
            current.begin();
            Account acc = _bank.create_account(name);
            System.out.println("Credit the Account");
            acc.credit(fbalance);
            System.out.println("Attempt to commit the account creation transaction");
            current.commit(false);
        }
        catch (Exception e)
        {
            System.err.println("ERROR - " + e);
        }
View Full Code Here

TOP

Related Classes of org.omg.CosTransactions.Current

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.