File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Local vs Remote EJB's in clustered environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Local vs Remote EJB Watch "Local vs Remote EJB New topic
Author

Local vs Remote EJB's in clustered environment

Ruud Steeghs
Ranch Hand

Joined: Jul 09, 2001
Posts: 56
Hi,

Our system is a web application using SLSB's in a clustered environment on WAS 5.0 (with an upcoming upgrade to WAS 5.1)
Untill now we have used Remote SessionBeans.

Correct me if I am mistaken:
we can use Local EJB's (SLSB) when the web container and EJB container are running in the same JVM.

How can I determine if the web container and EJB container are running in the same JVM?
Is this something I can configure in WAS, where?

Regards,

Ruud
[ August 22, 2005: Message edited by: Ruud Steeghs ]
Lars Vonk
Ranch Hand

Joined: Aug 05, 2005
Posts: 30
Hello Ruud,

Yes you are right, if your webcontainer and EJB container run in the same JVM you can use local interfacing.
In WAS 5 each application server has it own JVM. So if your web container and ejb container are in the same application server they are in the same JVM.
This also means that if you have multiple applications deployed in the same application server they also run in the same JVM.

Check out this redbook http://www.redbooks.ibm.com/redbooks/SG246195/ for more information about the websphere application server.

Regards,
Lars
Ruud Steeghs
Ranch Hand

Joined: Jul 09, 2001
Posts: 56
We've got a clustered environment with two (maybe three) machines with 2 WAS instances on it. So we've got 4, maybe 6 WAS instances with the whole application deployed on each WAS instance.
There's a load balancer taking care of balancing the load of all requests to the WAS instances.

Is there any reason to use Remote SLSB's (being called from the web app)?

Cheers,

Ruud.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30382
    
150

Originally posted by Ruud Steeghs:
Is there any reason to use Remote SLSB's (being called from the web app)?

Only if you think there is a chance that the web layer will want to call an arbitrary EJB. In practice, this is unlikely to happen. And if it does, you can change your deployment descriptor then.


[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
Hiroshi Tominaga
Greenhorn

Joined: Apr 21, 2005
Posts: 29
Hi Ruud,
Local vs Remote interfaces?.....mmm...
The methods in your ejb's are reusable or may become reusable by another application in the future? if that's the case then you should implement remote interface.
But if the methods in your ejb's are only used by your webmodule then you should implement local interface so you can get better performance.
I see no complication by implementing local & remote interfaces, that way you could use local interfaces for now, and when the time comes for an application to use your ejb's methods, they could get them using the already implemented remote interface.

Consider the fact that remote interface is more expensive in performance that local interface.

best regards...


SCJP 1.4, <br />IBM Certified System Administrator Websphere Application Server 5.0, IBM Certified DB2 UDB Database Associate
 
wood burning stoves
 
subject: Local vs Remote EJB's in clustered environment