JNDI directory and EJB local/remote calls

Discussions

EJB design: JNDI directory and EJB local/remote calls

  1. JNDI directory and EJB local/remote calls (2 messages)

    Hi J2EE experts,

    I've been working in a j2ee/ejb based applicacion and I've some questions related to the server's container and application management. There are my questions:

    1. Can I do local calls between diferents EJBs in differents EARs/applications but in the same container or only remotes calls ?

    2. Are the jndi names directory entries for the entire server container or only for application ?

    this question is oriented mainly if a can have a EJB object in EJBModule1 in a specific EAR with the jndi name ejb/AccountEjb, and another EJB object in another module (EJBModule2) in another EAR with the same jndi name) of course in the same container.

    What will happen with this situation ?


    thanks for your advise

    Threaded Messages (2)

  2. Interesting questions... Page 54 of EJB 2.1 spec includes the following:
    A local client is a client that is collocated in the same JVM with the session or entity bean that provides the local client view and which may be tightly coupled to the bean. A local client of a session bean or an entity bean may be another enterprise bean (a session bean, entity bean, or message-driven bean) or a web component.
    It makes me thinking that you can do local calls between the EJBs in different applications (I know for sure that WebSphere has one JVM for entire server).

    How do you do the calls? The difference will be only in the JNDI name used during lookup. I would expect the EJB reference name to be prefixed by the name of another application. The separator will be either "/" or "#"
  3. JNDI[ Go to top ]

    2. Are the jndi names directory entries for the entire server container or only for application ?
    The jndi names should be unique the entire server container.
    this question is oriented mainly if a can have a EJB object in EJBModule1 in a specific EAR with the jndi name ejb/AccountEjb, and another EJB object in another module (EJBModule2) in another EAR with the same jndi name) of course in the same container. What will happen with this situation ? thanks for your advise
    Same jndi name would not work, the second ear, when deployed would probably get a jndi binding error, unless the container has its own extensions to handle this.