Please study the tables in
EJB Core Spec Chapter 14 , it clearly state out all the circumstances for application exception and system exception.
For a short answer, Bean A is the client , Bean B is having the bean method invoked by client. When bean method throw System Exception, only the bean which bean method declared on is discarded by container, that is Bean B.
Bean A does get the exception, but it is not the system exception throw from Bean B, the exception get by Bean A is the exception throw by container, which is different depend on transaction context:
[the below is for session bean]
(1) For bean method which invoked in client transaction context
- EJBTransactionRollbackException (local client)
- TransactionRollbackException (remote client which extends Remote)
(2) For bean method which invoked in new transaction context
- EJBException
- RemoteException (remote client which extends Remote)
(3) For bean method which invoked in unspecified transaction context (means no transaction)
- EJBException
- RemoteException (remote client which extends Remote)
[check it out yourself , if the transaction is BMT ...... also put in some hardwork for MDB also]
Please study EJB Core Spec, All The Best ~ !!!