I'm using CMT in EJB3 state-less session beans. Also I've created my own Exception having the annotation "@ApplicationException (rollback=true)".
Do I have to use "context.setRollbackOnly()" when I want to rollback the transaction?
Can I just rollback the transaction by throwing an exception inside public method in the bean?
If so (the answer to Q#2 is yes) do I have to throw the exception out of the method by declaring the exception in the method or will it be sufficient to just throw an exception inside the method and handle it inside the same method itself? (I don't want to propagate the exception to the next level. I just want to rollback the exception.)
Thanks in advance. ;)