use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ImplicitObject_TranCommit_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 implicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ImplicitObject implicitObject = ImplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(implicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
implicitObject.tran_rollback_nulloper();
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 + "_ImplicitObject_TranCommit_TranRollbackNullOper", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ImplicitObject_TranCommit_TranRollbackNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ImplicitObject_TranCommit_TranRollbackNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ImplicitObject_TranCommit_TranRollbackWriteLock 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 implicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ImplicitObject implicitObject = ImplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(implicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
implicitObject.tran_rollback_writelock();
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 + "_ImplicitObject_TranCommit_TranRollbackWriteLock", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ImplicitObject_TranCommit_TranRollbackWriteLock.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ImplicitObject_TranCommit_TranRollbackWriteLock.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ImplicitObject_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 implicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ImplicitObject implicitObject = ImplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(implicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
implicitObject.tran_commit_nulloper();
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 + "_ImplicitObject_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_ImplicitObject_TranRollback_TranCommitNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ImplicitObject_TranRollback_TranCommitNullOper.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ImplicitObject_TranRollback_TranCommitWriteLock 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 implicitObjectIOR = ServerIORStore.loadIOR(args[args.length - 1]);
ImplicitObject implicitObject = ImplicitObjectHelper.narrow(ORBInterface.orb().string_to_object(implicitObjectIOR));
boolean correct = true;
Date start = new Date();
for (int index = 0; index < numberOfCalls; index++) {
AtomicTransaction atomicTransaction = new AtomicTransaction();
atomicTransaction.begin();
implicitObject.tran_commit_writelock();
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 + "_ImplicitObject_TranRollback_TranCommitWriteLock", operationDuration);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client_ImplicitObject_TranRollback_TranCommitWriteLock.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ImplicitObject_TranRollback_TranCommitWriteLock.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of com.arjuna.ats.jts.extensions.AtomicTransaction in project narayana by jbosstm.
the class Client_ExplicitObject_TranCommit_NoTranReadLock 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_readlock(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_NoTranReadLock", 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_NoTranReadLock.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client_ExplicitObject_TranCommit_NoTranReadLock.main: " + exception);
exception.printStackTrace(System.err);
}
}
Aggregations