use of javax.transaction.TransactionRequiredException in project Payara by payara.
the class TransactionalInterceptorMandatory method transactional.
@AroundInvoke
public Object transactional(InvocationContext ctx) throws Exception {
_logger.log(FINE, CDI_JTA_MANDATORY);
if (isLifeCycleMethod(ctx)) {
return proceed(ctx);
}
setTransactionalTransactionOperationsManger(false);
try {
if (getTransactionManager().getTransaction() == null) {
throw new TransactionalException("TransactionRequiredException thrown from TxType.MANDATORY transactional interceptor.", new TransactionRequiredException("Managed bean with Transactional annotation and TxType of " + "MANDATORY called outside of a transaction context"));
}
return proceed(ctx);
} finally {
resetTransactionOperationsManager();
}
}
Aggregations