- Invoking javax.ejb.EJBLocalObject.getPrimaryKey() on a session bean results in javax.ejb.EJBException been thrown. - Invoking javax.ejb.EJBLocalHome.remove(java.lang.Object primaryKey) on a session bean results in javax.ejb.EJBException been thrown. - Invoking javax.ejb.EJBHome.remove(java.lang.Object primaryKey) on a session bean results in java.rmi.RemoteException been thrown. - Invoking javax.ejb.EJBObject.getPrimaryKey() on a session bean results in java.rmi.RemoteException been thrown.
Any methods associated with a primary key defined by a local home or component interface raises a javax.ejb.EJBException if the method is invoked on a session bean. Likewise, any methods associated with a primary key defined by a remote home or component interface raises a java.rmi.RemoteException if the method is invoked on a session bean.
But specs says: 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.
Hi, Can you please quote the point where the specs specify this. Because I firmly believe that in such a case a Remote or an EJB Exception is thrown based on local and home interfaces. But then again nothing is above specs, it's just that sometimes we misinterpret them. Happens all the time with me.
I guess You are correct. On further introspection I found the same thing written on Page 130 of the HF EJB book. I'm sorry for misleading you in the beginning and thanks for bringing this up, as I also am planning to take the exam sometime next week.