I have a couple questions about the scope of JNDI lookup of ejb-refs.
1. Is non-EJB code running within the scope of a method called on an EJB object
able to look up ejb-refs? Suppose I have an entity bean Foo, implemented in the
FooBean class, whose deployment descriptor defines some ejb-ref. Should JNDI
lookups of that ejb-ref only work in the code that is directly in the FooBean
class' method implementations, or should they also work from other Java code
that I call from FooBean method implementations (such as a Java class I might
implement to factor out some common implementation between several entity
beans)? Would it make a difference whether that other Java code is included in
the same jar file with Foo?
2. When there are nested invocations of EJB objects, are ejb-refs defined in an
outer scope visible to a lookup performed in the inner scope?  Suppose session
bean Foo (which defines some ejb-ref) calls a method on entity bean Bar. If the
BarBean implementation does a lookup of that ejb-ref name, and that ejb-ref is
not defined in Bar's deployment descriptor but is defined in Foo's deployment
descriptor, would it be not found, or would it find the ejb-ref defined by Foo?
Would it make a difference whether Bar is included in the same jar file with
Foo? Although I described a scenario of a session bean calling an entity bean, I
assume the answer would be the same if they were both entities.

As far as I can tell the EJB1.1 or J2EE1.2 specs don't specifically address
these scenarios, which would mean the results in either of these scenarios are
undefined and might work one way in one server and another in a different one.
But I wondered if I were missing something, or if was the intent of the spec to
define the behavior for these scenarios.

Erik Voldal
Email: [EMAIL PROTECTED]
Phone: 507-253-4788

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to