/**
* Creates a gtx (if one doesnt exist), a sync handler, and registers the tx.
*/
private GlobalTransaction registerTransaction(Transaction tx, InvocationContext ctx) throws Exception
{
GlobalTransaction gtx;
if (TransactionTable.isValid(tx) && transactions.add(tx))
{
gtx = txTable.getCurrentTransaction(tx, true);
TransactionContext transactionContext;
if (ctx.getGlobalTransaction() == null)
{
ctx.setGlobalTransaction(gtx);
transactionContext = txTable.get(gtx);
ctx.setTransactionContext(transactionContext);
}
else
{
transactionContext = ctx.getTransactionContext();
}
if (gtx.isRemote())
{
// should be no need to register a handler since this a remotely initiated globalTransaction
if (trace) log.trace("is a remotely initiated gtx so no need to register a tx for it");
}
else