• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Service Locator vs EJB Refs

 
Rahul Devgan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Please help me with thw following choice wrt Performance:
Should I use ejb-refs to local beans(in the same .ear file) or should I use service locators when my clients are also ejbs.
What is the better possibly best way of looking up entities from session beans?
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rahul,
I'd also be interested in an answer to this. I suspect a service locator is not needed on the EJB tier, but I'm ready to be converted.

Ray
 
Rahul Devgan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following in mind:

If the session bean is making local calls to all these beans then it should try going thru' ejb-ref.
On the other hand in the exception block of the above mentioned call, that is to say that local call failed and session bean has to make a remote call, it should use Service Locator's cached reference.

All replies would be welcome.

There is another thing to consider here wrt clustering, even if my bean is in the same .ear, it might or might not be running in the same heap. I am a bit short on this one, can anybody help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic