[wildfly-dev] Handling @TransactionAttribute exceptions

Gytis Trikleris gytis at redhat.com
Fri Jul 26 06:10:37 EDT 2013


Hello,

I need to handle exception when either 
TransactionAttributeType.MANDATORY or TransactionAttributeType.NEVER 
requirement is not met. It is not a problem for MANDATORY, because 
EJBTransactionRequiredException is thrown. However, general EJBException 
exception is thrown if unexpected transaction was on the thread.

I wanted to ask what is the best way to detect that EJBException was 
caused because of unnecessary transaction? Error code given by the 
exception is JBAS014163, but I am not sure if it is safe to rely on 
message codes...

Thanks,
Gytis


More information about the wildfly-dev mailing list