Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RemoteHome vs LocalHome  RSS feed

 
Dhineshkumar raj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Am new to EJB. Am preparing for SCBCD exam. Can any one clear this doubt?

What is the advantage of LocalHome & LocalObject over RemoteHome and RemoteObject interfaces??

In which situation we have to choose LocalHome & LocalObject interface??
In which situation we have to choose RemoteHome & RemoteObject interface??


Thanks in advance
Dhinesh Kumar R
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhinesh,
Welcome to JavaRanch!

An obvious one that jumps out at me that if you are in same EJB container, there is no reason to make a remote call. In practice, many app servers will optimize a remote call into a local one in this case.
 
Ray Johnson
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Local interfaces were introduced to enable in-memory (reference) based calls to EJBs. Assume you have two EJBs, say A & B where A calls a method in B. If A is deployed in server 1 and B is deployed in server 2, then you have to use B's Remote interface in A to call B's method. If both are deployed in server 1 then it is better to use B's local interface in A to call B. This is just to understand in the beginning.
Now, replace server 1 and server 2 in the above examples by JVM 1 & JVM2.
Replace A by EJB client (can be a web app).
And read the above example again. There you go!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!