0 Replies Latest reply on Mar 5, 2014 5:01 PM by dazzer001

    Question on what gets returned by a JNDI lookup?

    dazzer001 Newbie

      I am trying to understand how a local JNDI lookup of an EJB gets implemented.


      For example, if in my web application I perform an explicit lookup of a local EJB:


      (MyInterface) initialContext.lookup(JNDI_NAME)


      Then under what circumstances do I get a reference to the underlying bean? Do I always get a proxy object? Are things different if I use EJB injection?


      If I get a reference to the underlying bean, then when does it get returned to the pool?


      If I get a reference to a proxy object, then at what point does the bean get fetched / returned to the pool? Is it during method invocation?


      What does the EJB3 spec have to say regarding this?


      If there are any articles that discuss this, then please post a link.