This content has been marked as final.
Show 6 replies
-
1. Re: Transaction does not rollback
starksm64 Dec 21, 2005 10:51 AM (in response to pieterjan)application defined exceptions to not rollback the current transaction. You need to use the context setRollbackOnly to achieve this effect.
-
2. Re: Transaction does not rollback
norman.richards Dec 21, 2005 11:52 AM (in response to pieterjan)You could throw an exception that is marked with @ApplicationException(rollback=true) instead of just throwing a generic Exception. The container will mark the tx for rollback without you needing to inject SessionContext.
-
3. Re: Transaction does not rollback
c_eric_ray Jan 25, 2007 12:51 PM (in response to pieterjan)"scott.stark@jboss.org" wrote:
application defined exceptions to not rollback the current transaction. You need to use the context setRollbackOnly to achieve this effect.
I need to do just this very thing. However, for the life of me I cannot figure out how to get a refence to the EJBContext. -
4. Re: Transaction does not rollback
wolfgangknauf Jan 26, 2007 8:16 AM (in response to pieterjan)Take a look at this:
http://javahowto.blogspot.com/2006/06/4-ways-to-get-ejbcontext-in-ejb-3.html
Hope this helps
Wolfgang -
5. Re: Transaction does not rollback
alrubinger Jan 26, 2007 11:51 AM (in response to pieterjan)"scott.stark@jboss.org" wrote:
application defined exceptions to not rollback the current transaction. You need to use the context setRollbackOnly to achieve this effect.
This can't still be true?
S,
ALR -
6. Re: Transaction does not rollback
c_eric_ray Feb 12, 2007 11:23 AM (in response to pieterjan)You can annotate a user defined exception as such
@ApplicationException(rollback=true) public class MyException extends Exception { ... }
This instructs the TM to rollback if this exception is thrown.