This week's book giveaway is in the Testing forum. We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line! See this thread for details.
If you call javax.ejb.EJBLocalHome.remove(java.lang.Object pk) on a session bean do you get a javax.ejb.RemoveException ( as stated on page 559 in HFEJB) OR javax.ejb.EJBException (Mock Answer to Q2 on www.ejbcertificate?)
The same confusion exists over calling javax.ejb.EJBHome.remove(java.lang.Object pk) on a session bean. Is it a java.rmi.RemoteException or a javax.ejb.RemoveException?
Hi Simon, I had the same confusion about the answer to this question in www.ejbcertificate.com and I reported them that the answer is incorrect. But I am not sure whether they corrected it. Anyway, I think the correct answer is - a javax.ejb.RemoveException will be thrown in both the cases. Because what the spec says about this is the following
Remote Home Interface [Section 6.3.2 p59] Because session objects do not have primary keys that are accessible to clients, invoking the javax.ejb.EJBHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.
Local Home Interface [Section 6.4.2 p60] Because session objects do not have primary keys that are accessible to clients, invoking the javax.ejb.EJBLocalHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.
Hope this helps Suman
Suman A Sarker<br />SCJP, SCWCD, SCBCD<br /> <br />If You Can't Beat Them ... Join Them!