• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Some Questions

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic