conceptual problem ....please help

G

gk

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top