@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public String testXA(String testEntityPK, boolean reverseOrder, ASFailureSpec... specs)
{
log.info("CMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);
TestASRecoveryWithJPA xatest = new TestASRecoveryWithJPA();
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
{
xatest.setTestEntityPK(testEntityPK);
xatest.setReverseOrder(reverseOrder);
for (ASFailureSpec spec : specs)
xatest.addResource(spec);
xatest.startTest(tx);
return "Passed";
}
}