May 2001
Intermediate to advanced
1088 pages
30h 13m
English
There are cases when an entity bean needs to pass a reference to itself to another entity bean. In a non-EJB program, you occasionally need to pass this as a parameter to a method. In the EJB world, however, a remote method usually expects a Remote interface as a para meter, and the this reference for an implementation class is not a proper remote reference, even if the implementation class implements the Remote interface.
When you need to pass the equivalent of this—that is, when you need a remote reference to the current bean, whether it be a session bean or an entity bean—use the getEJBObject method in the EntityContext (or SessionContext) object. Don't forget to use the PortableRemoteObject.narrow ...
Read now
Unlock full access