Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused on EJB look Up Strategies

 
sandeeprajsingh tandon
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using the following 2 strategies in 2 of my EJB3.0 Projects to look up Session Beans.

a) A Session bean is annotated with @STATELESS and there is a Local Interface to look up marked with @LOCAL and the look up is performed in the client as

context.lookup(prefs.get(
"MySessionBean",
"MyProject.MySessionBeanLocal"));


b) A Session bean is annotated with @STATELESS and there is a Local Interface to look up marked with @LOCAL and the look up is performed in the client as

ResourceLocator.lookup(MySessionBean.class);
along with this an entry has to be configured in the resource-binding property file
mySessionBean=openejb\:MyProject.mySessionBean

Please let me know the differences, positives and the negatives of the 2 strategies.
WOuld really appreciate any info on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic