conceptual problem ....please help

Discussion in 'Java' started by gk, Nov 7, 2006.

  1. gk

    gk Guest

    hi,
    I have a question on EJB.

    suppose I have a SessionBean and an EntityBean.
    Now, SessionBean wants to call EntityBean.

    I found you can call via EJB references.

    like this inside sessionbean you can have

    InitialContext namingContext = new InitialContext();
    Object ref = namingContext.lookup("java:comp/env/ejb/myBean"); // this
    JNDI is a reference


    my question is , what BENEFIT i would get if i call via EJB
    reference instead of global JNDI name ?

    if you are getting confused , see this link
    http://java.boot.by/ibm-287/images/030106.gif

    did you see , there is ejb reference name="ejb/TravelAgent"

    and also

    global websphere binding name

    "ejb/com/titan/travelagent/TravelAgentHome"


    we can call a bean by using either of above.....but we prefer to make a
    reference and use EJB reference ......WHY ? what extra benefit i
    will get if i make a EJB reference and call by EJB reference ?

    thank you
    gk, Nov 7, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lloyd Dupont

    conceptual problem

    Lloyd Dupont, Jan 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    485
    Lloyd Dupont
    Jan 4, 2006
  2. google 24/7
    Replies:
    10
    Views:
    885
    Roedy Green
    Feb 24, 2006
  3. Daniel Ladd

    Problem with a conceptual graph

    Daniel Ladd, Jul 19, 2004, in forum: C++
    Replies:
    4
    Views:
    364
    Brian McGuinness
    Jul 20, 2004
  4. Thom Anderson

    Seeking a Conceptual Approach Please

    Thom Anderson, Jun 30, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    316
    Robbe Morris [C# MVP]
    Jul 6, 2006
  5. stephen
    Replies:
    4
    Views:
    372
    stephen
    Dec 14, 2006
Loading...

Share This Page