| ------------------------------------
5.3.2 Removing a session object
A client may remove a session object using the remove() method on the javax.ejb.EJBObject
interface, or the remove(Handle handle) method of the javax.ejb.EJBHome interface.
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.
------------------------------------
5.5 Session object identity
Session objects are intended to be private resources used only by the
client that created them. For this reason, session objects, from the
client's perspective, appear anonymous. In contrast to entity objects,
which expose their identity as a primary key, session objects hide their
identity. As a result, the EJBObject.getPrimaryKey() and
EJBHome.remove(Object primaryKey) methods result in a java.rmi.RemoteException
if called on a session bean. If the EJBMetaData.getPrimaryKeyClass()
method is invoked on a EJBMetaData object for a Session bean, the method throws
the java.lang.RuntimeException.
------------------------------------
Sections 5.3.2 and 5.5 conflict. 5.3.2 says to throw javax.ejb.RemoveException, 5.5 says to
throw java.rmi.RemoteException.
For now, we are going with java.rmi.RemoteException.
|