aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes difference in Local & Remote Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "difference in Local & Remote" Watch "difference in Local & Remote" New topic
Author

difference in Local & Remote

Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
I am reading book on EJB but I am not getting the difference between Remote Interface & Local Interface. Both Interfaces are used for Stateless & Statefull Session Beans. so on which condition it is determined which one to use.

suppose there is Server S on which EJB Container & my project resides. client A , B & C access S . so in my application which interface would be use local or Remote ?


SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Saurabh Naik wrote:I am reading book on EJB but I am not getting the difference between Remote Interface & Local Interface. Both Interfaces are used for Stateless & Statefull Session Beans. so on which condition it is determined which one to use.

suppose there is Server S on which EJB Container & my project resides. client A , B & C access S . so in my application which interface would be use local or Remote ?

If you are calling the EJB from within the same EAR file, you would use use a local interface for performance purposes. If you are calling from another EAR, you would use a remote interface. Some application servers optimize remote calls if the two EARs are on the same server, but it's still clearer to use remote yourself.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
but EAR are kept on servers & client calls it that means is it a local ? and suppose in my application there are 2 EAR kept on servers. client calls the 1 EAR but for manipulating purpose it uses 2nd EAR then it is Remote . that means 1st EAR calls 2nd EAR. am I correct ?
 
 
subject: difference in Local & Remote