• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some Questions

 
Dan T
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. From hf-ejb, it shows that for entity beans, the context exists inside the pool with the bean, while for statless session beans, the conext is linked to the bean, but outside of the pool. How come it is implemented this way?

2. Whats the point of having a getPrimaryKey in the EntityContext if there is one from the EJBObject interface?

3. I am not clear of how virtual fields work, and its relationship to getters and setters. I remeber reading that JDBC subclasses our entity bean, is this why the virtual fields are abstract?

4. In the Handle class, it has the method Object getEJBObect().
If we do handle.getEJBObject(), wouldnt that return the component interface already? Why do we need a narrow/cast?
Thanks

[ July 31, 2004: Message edited by: Ryan Wong ]

[ July 31, 2004: Message edited by: Ryan Wong ]
[ July 31, 2004: Message edited by: Ryan Wong ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ryan Wong:
4. In the Handle class, it has the method Object getEJBObect().
If we do handle.getEJBObject(), wouldnt that return the component interface already? Why do we need a narrow/cast?
Thanks


I've got a sensible answer only to your fourth question. The Handle.getEJBObject returns a stub to a Remote object (EJBObject). Because each EJB 2.0 compliant container needs to implemented the RMI-IIOP protocol (to be CORBA compliant), and because the RMI-IIOP protocal doesn't guarantee that the return object is castable to the Remote Component Interface type, the client needs to perform a narrow and then a cast to the object returned by the above method. The process is the same as a remote client would get a EJBHome stub from a JNDI lookup.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic