I am a newbie to EJB3 and JTA, and am finding their behaviour a little confusing. Let us say I have a SFSB A that calls another SFSB B:
1. If B throws a regular Exception (not a RuntimeException) do both B and A have an opportunity to catch it and process it without triggering JTA rollback?
2. If B throws a RuntimeException (such as a NumberFormatException) do both B and A have an opportunity to catch it and process it without triggering JTA rollback? If not, how does JBoss know the NumberFormatException occurred? Is it using some kind of AOP?
3. It seems that if B throws a RuntimeException and A tries to (clean up and then) rethrow it, I get a nasty 'Transaction already marked for rollback' exception. The annoying thing is that this 'Transaction already marked for rollback' exception does not include the original Exception as a cause, so my original Exception is lost forever? I'm not sure 4.0.4.RC1 did this.
Your help is much appreciated,
Sorry - I am using 4.0.4.CR2 (I meant to say that in the subject heading)