From Q3 HFEJB Page 425 When a remote client invokes a method on an entity bean using container-managed persistence, and that bean has already beean removed ,what exception will be thrown? ans java.rmi.NoSuchObjectException
As case.If local client called method ? what exception will be thrown?
would you please advice me Thank a lot for your kindly advice
If I don't make dust. I may eat dust.<br />SCJP 1.4 ,SCWCD 1.4,SCBCD 1.3
HJEJB Page 425, Question 3: When a remote client invokes a method on an entity bean using container-managed persistence, and that bean has already been removed, what exception will be thrown?
I'm not challenging the provided solution. What I'm trying to say here is that the question is rather unclear here. Were they looking for the exception thrown by the bean or by the container?
If it was asking for the exception thrown by the container, the provided solution is obviously correct.
But I could also argue that the bean throws NoSuchEntityException, and that is also correct. Moreover, the question did not state what method was invoked. It could be remove, ejbLoad, ejbStore or any business methods defined in the component interface.
But of course to the client, it could see RemoteException/EJBException or the more specific NoSuchObjectException/NoSuchObjectLocalException.