Search in sources :

Example 31 with NoTransaction

use of org.omg.CosTransactions.NoTransaction in project narayana by jbosstm.

the class Test14 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        current.begin();
        current.rollback();
        try {
            current.commit(false);
            correct = false;
        } catch (NoTransaction noTransaction) {
        }
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test14.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test14.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 32 with NoTransaction

use of org.omg.CosTransactions.NoTransaction in project narayana by jbosstm.

the class Test15 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        current.begin();
        current.rollback();
        try {
            current.rollback();
            correct = false;
        } catch (NoTransaction noTransaction) {
        }
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test15.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test15.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Aggregations

NoTransaction (org.omg.CosTransactions.NoTransaction)32 Current (org.omg.CosTransactions.Current)17 SystemException (org.omg.CORBA.SystemException)9 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)5 CosTransactions.otid_t (org.omg.CosTransactions.otid_t)5 CurrentImple (com.arjuna.ats.internal.jts.orbspecific.CurrentImple)4 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)4 HeuristicHazard (org.omg.CosTransactions.HeuristicHazard)4 HeuristicMixed (org.omg.CosTransactions.HeuristicMixed)4 Inactive (org.omg.CosTransactions.Inactive)4 BAD_PARAM (org.omg.CORBA.BAD_PARAM)3 WrongTransaction (org.omg.CORBA.WrongTransaction)3 Unavailable (org.omg.CosTransactions.Unavailable)3 GlobalTransactionInfo (com.arjuna.ArjunaOTS.GlobalTransactionInfo)2 Uid (com.arjuna.ats.arjuna.common.Uid)2 ObjectStoreException (com.arjuna.ats.arjuna.exceptions.ObjectStoreException)2 ControlWrapper (com.arjuna.ats.internal.jts.ControlWrapper)2 TransactionFactoryImple (com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple)2 Test (org.junit.Test)2 UserException (org.omg.CORBA.UserException)2