Search in sources :

Example 6 with InvalidControl

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

the class Test27 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();
        Control control = current.get_control();
        current.commit(false);
        try {
            current.resume(control);
        } catch (InvalidControl invalidControl) {
            System.err.println("Failed to resume committed transaction!");
            correct = false;
        }
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test27.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Testt27.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : Control(org.omg.CosTransactions.Control) InvalidControl(org.omg.CosTransactions.InvalidControl) Current(org.omg.CosTransactions.Current) InvalidControl(org.omg.CosTransactions.InvalidControl)

Aggregations

InvalidControl (org.omg.CosTransactions.InvalidControl)6 Control (org.omg.CosTransactions.Control)4 Current (org.omg.CosTransactions.Current)4 ControlWrapper (com.arjuna.ats.internal.jts.ControlWrapper)2 ActionControl (com.arjuna.ArjunaOTS.ActionControl)1 BAD_OPERATION (org.omg.CORBA.BAD_OPERATION)1 BAD_PARAM (org.omg.CORBA.BAD_PARAM)1 OBJECT_NOT_EXIST (org.omg.CORBA.OBJECT_NOT_EXIST)1 SystemException (org.omg.CORBA.SystemException)1 UNKNOWN (org.omg.CORBA.UNKNOWN)1 UserException (org.omg.CORBA.UserException)1 Coordinator (org.omg.CosTransactions.Coordinator)1