If a local client in a transaction context invokes a business method on a bean with container-managed transactions, what exception does the client receive if the bean instance throws a non-application exception?
When the transaction is rolled back by CONTAINER in the result of system exception, and a client try to commit the transaction, transactionRolledback(Local)Exception will thrown.
When the transaction is marked rollback only by bean, and a client try to commit the transaction, the TransactionRolledback(Local)Exception will NOT thrown.
Am I right ? Why is TransactionRolledback(Local)Exception thrown in the above situation?
SCBCD, SCWCD, SCJP
Joined: Jun 20, 2003
After I review Val's cheap sheet on exception, I realize this has something to do with if the tx is started by the caller or not. If the exception occurs in the same tx context as the caller, the TransactionRolled(Local)backException will be thrown, otherwise client will receive either EJBException or RemoteException.