@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public String testXA(ASFailureSpec... specs)
{
log.info("CMT testXA called with " + specs.length + " specs");
TestASRecovery xatest = new TestASRecovery();
Transaction tx;
try
{
tx = com.arjuna.ats.jta.TransactionManager.transactionManager().getTransaction();
}
catch (javax.transaction.SystemException e)
{
tx = null;
}
if (tx == null)
{
log.error("CMT testXA called without a transaction");
return "Failed";
}
else
{
for (ASFailureSpec spec : specs)
xatest.addResource(spec);
xatest.startTest(tx);
return "Passed";
}
}