try
{
ORBInterface.initORB(args, null);
OAInterface.initOA();
TransactionFactory transactionFactory = null;
String[] transactionFactoryParams = new String[1];
transactionFactoryParams[0] = ORBServices.otsKind;
transactionFactory = TransactionFactoryHelper.narrow(ORBServices.getService(ORBServices.transactionService, transactionFactoryParams));
int numberOfControls = Integer.parseInt(args[args.length - 1]);
boolean correct = true;
for (int index = 0; correct && (index < numberOfControls); index++)
{
Control control = transactionFactory.create(0);
correct = correct && (control.get_coordinator().get_status() == Status.StatusActive);
control.get_terminator().commit(true);
}