super(annotation, next, test);
}
public void evaluate() throws Throwable {
TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class);
JtaTransactionPolicyFactory factory = new JtaTransactionPolicyFactory(transactionManager);
TransactionType transactionType = TransactionType.get(annotation.value());
// This creates *and* begins the transaction
TransactionPolicy policy = factory.createTransactionPolicy(transactionType);
try {
next.evaluate();
} catch (Throwable t) {
if (!isApplicationException(t)) policy.setRollbackOnly();
} finally {