if ((args[i].compareTo("-crash") == 0))
crash = true;
}
// Create a new JBoss transaction
AtomicAction tx = new AtomicAction();
// Allocate space to monitor the transaction, this variable is overriden each time the transaction is used.
int actionStatus = tx.begin(); // Top level begin
// If the transaction was successful began
if (actionStatus == ActionStatus.RUNNING)
{
// Enlist the participant
int addOutcome = tx.add(new SimpleRecord(crash));
// If the participant was succesfully added to the intentions list
if (addOutcome == AddOutcome.AR_ADDED)
{
System.out.println("About to complete the transaction ");
// Try to complete the transaction as requested by the user
if (commit)
actionStatus = tx.commit(); // Top level commit
else
actionStatus = tx.abort(); // Top level rollback
System.out.println("The status of the transaction is " + ActionStatus.stringForm(actionStatus));
}
else
{