I use JSF 2 and EJB 3.
I think my use case is pretty simple :
A JSF backing bean is calling a method on an injected ejb. The ejb can throw a custom exception. When the exception occurs, I want the transaction to be rollbacked AND the exception to be catched in my JSF bean (so it can deal with the user).
So I annotated my custom exception with @ApplicationException(rollback=true) and threw it from my ejb method.
But my problem is that my custom exception never makes it to the jsf bean. Instead, it comes wrapped in a EJBTransactionRolledBackException.
If I annotate my exception with @ApplicationException(rollback=false), then the transaction is not rolled back and the exception is catched by the JSF bean.
Is there a mean to rollback a transaction AND to throw an Application exception catchable ?
Could it be glassfish specific ? (i'm using glassfish 3.1.1).