Hi Everyone
Folowing is a question from mock exam (difficult question 1/20) given at
www.ejbcertificate.com Q. Which of the following statements are true when a session bean's client receives a java.rmi.RemoteException? [Check all correct answers]
1 The client will never receive a java.rmi.RemoteException.
2 The client calls the session bean from another JVM.
3 The client calls the session bean from within the same JVM.
4 The container throws a java.rmi.RemoteException if the container performs a transaction rollback.
5 The throws clauses of all methods in the remote home and component interface must declare a java.rmi.RemoteException.
The answer given is options 2, 4 and 5. along with the following explanation :
The Container catches a non-application exception; logs it (which can result in alerting the System Administrator); and, unless the bean is a message-driven bean, throws the java.rmi.RemoteException (or subclass thereof) to the client if the client is a remote client, or throws the javax.ejb.EJBException (or subclass thereof) to the client if the client is a local client.
I think option 4 is not correct because the container need not always throw
java.rmi.RemoteException whenever it rolls back a transaction. Am I correct?