According to this API :http://docs.oracle.com/javaee/6/api/javax/ejb/EJBTransactionRolledbackException.html
It says, EJBTransactionRollbackException is thrown to a remote client telling the client that the client's transaction is marked for rollback or has been rolled back.
But when I tried, this exception can be thrown to a local callee bean which in the same .war file as the bean that throws a system exception and causes the transaction to be marked for rollback.
I have two more days before my exam. I am keeping my fingers cross now.
I tried with two @LocalBean , BeanA and BeanB. The servlet client and the beans are in the same .war file. The EJBTransactionRollbackException is thrown to BeanA, even though BeanA and BeanB are local to each other.
Warning: A system exception occurred during an invocation on EJB BeanA method public void com.ivan.scbcd6.BeanA.methodA()
Caused by: javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
Caused by: java.lang.RuntimeException: run time exception from b
Warning: StandardWrapperValve[OtherServlet]: PWC1406: Servlet.service() for servlet OtherServlet threw exception
Some time ago I was investigating this question also.
The conclusion is (14.3.1 of EJB Sepcification):
If you're using EJB 3.x approach the EJBTransactionRolledBackException for both Local and Remote beans.
If you're using EJB 2.1 then exception depends on if it's Local (EJBTransactionRolledBackException) or Remote (javax.transaction.TransactionRolledbackException) bean.
Not so fast naughty spawn! I want you to know about
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop