• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is EJB Context lookup

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB In Action Page 103:
To obtain EJB references to the Session bean one of the two methods can be used
a) EJB Context lookup.
b) JNDI Lookup.

I understand JNDI lookup which is done via InitialContext.lookup("JNDI name of the session bean");
How can one do EJB Context lookup.
Please clarify with an example code.
 
Mellon Sun
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it means javax.EJBContext.lookup()
 
Chandrashekhar Raiphale
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at following link, they have shown 2 way sof EJB lookup but both are using JNDI name ...let me now is this what you were expecting


http://www.theserverside.com/tt/articles/article.tss?l=SimplifyingEJB3
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing the article.

I think i had to read the "Simplify Client View". Now can i conclude
I understand JNDI lookup which is done via InitialContext.lookup("JNDI name of the session bean");
How can one do EJB Context lookup.: EJB Context lookup is done using @EJB Annotation, which avoids catching of unnecessary exception.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic