use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ExplicitObject_TranCommit_TranCommitNullOper method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
String prefix = args[args.length - 3];
int numberOfCalls = Integer.parseInt(args[args.length - 2]);
String explicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ExplicitObject explicitObject = ExplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(explicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
explicitObject.tran_commit_nulloper(OTS.current().get_control());
atomicTransaction.commit(true);
}
Date end = new Date();
float operationDuration = ((float) (end.getTime() - start.getTime())) / ((float) numberOfCalls);
System.err.println("Operation duration : " + operationDuration + "ms");
System.err.println("Test duration : " + (end.getTime() - start.getTime()) + "ms");
correct = PerformanceProfileStore.checkPerformance(prefix + "_ExplicitObject_TranCommit_TranCommitNullOper", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ExplicitObject_TranCommit_TranCommitNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ExplicitObject_TranCommit_TranCommitNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ExplicitObject_TranRollback_NoTranWriteLock method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
String prefix = args[args.length - 3];
int numberOfCalls = Integer.parseInt(args[args.length - 2]);
String explicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ExplicitObject explicitObject = ExplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(explicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
explicitObject.no_tran_writelock(OTS.current().get_control());
atomicTransaction.rollback();
}
Date end = new Date();
float operationDuration = ((float) (end.getTime() - start.getTime())) / ((float) numberOfCalls);
System.err.println("Operation duration : " + operationDuration + "ms");
System.err.println("Test duration : " + (end.getTime() - start.getTime()) + "ms");
correct = PerformanceProfileStore.checkPerformance(prefix + "_ExplicitObject_TranRollback_NoTranWriteLock", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ExplicitObject_TranRollback_NoTranWriteLock.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ExplicitObject_TranRollback_NoTranWriteLock.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ExplicitObject_TranRollback_TranRollbackNullOper method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
String prefix = args[args.length - 3];
int numberOfCalls = Integer.parseInt(args[args.length - 2]);
String explicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ExplicitObject explicitObject = ExplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(explicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
explicitObject.tran_rollback_nulloper(OTS.current().get_control());
atomicTransaction.rollback();
}
Date end = new Date();
float operationDuration = ((float) (end.getTime() - start.getTime())) / ((float) numberOfCalls);
System.err.println("Operation duration : " + operationDuration + "ms");
System.err.println("Test duration : " + (end.getTime() - start.getTime()) + "ms");
correct = PerformanceProfileStore.checkPerformance(prefix + "_ExplicitObject_TranRollback_TranRollbackNullOper", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ExplicitObject_TranRollback_TranRollbackNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ExplicitObject_TranRollback_TranRollbackNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ExplicitObject_TranCommit_NoTranNullOper method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
String prefix = args[args.length - 3];
int numberOfCalls = Integer.parseInt(args[args.length - 2]);
String explicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ExplicitObject explicitObject = ExplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(explicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
explicitObject.no_tran_nulloper(OTS.current().get_control());
atomicTransaction.commit(true);
}
Date end = new Date();
float operationDuration = ((float) (end.getTime() - start.getTime())) / ((float) numberOfCalls);
System.err.println("Operation duration : " + operationDuration + "ms");
System.err.println("Test duration : " + (end.getTime() - start.getTime()) + "ms");
correct = PerformanceProfileStore.checkPerformance(prefix + "_ExplicitObject_TranCommit_NoTranNullOper", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ExplicitObject_TranCommit_NoTranNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ExplicitObject_TranCommit_NoTranNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ExplicitObject_TranRollback_TranCommitNullOper method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
String prefix = args[args.length - 3];
int numberOfCalls = Integer.parseInt(args[args.length - 2]);
String explicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ExplicitObject explicitObject = ExplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(explicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
explicitObject.tran_commit_nulloper(OTS.current().get_control());
atomicTransaction.rollback();
}
Date end = new Date();
float operationDuration = ((float) (end.getTime() - start.getTime())) / ((float) numberOfCalls);
System.err.println("Operation duration : " + operationDuration + "ms");
System.err.println("Test duration : " + (end.getTime() - start.getTime()) + "ms");
correct = PerformanceProfileStore.checkPerformance(prefix + "_ExplicitObject_TranRollback_TranCommitNullOper", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ExplicitObject_TranRollback_TranCommitNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ExplicitObject_TranRollback_TranCommitNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
}
Aggregations