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
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