Enterprise JavaBeans - Clustering etc
Hi,
Sorry for long post and thanks for patience (read at leas first question (-:)
I would like to ask abt. session beans with Local interface in cluster enviroment and a WEB want to access such bean. I can guess that with stateless beans the situation is easy: the bean will be created locally and used, but what with stateful beans if the previous request was realized on other machine? will it replicate? on what basis?
My question is part of a bigger one: what are the cases where I need to use remote interface: I know "the sparate JVM or EAR" but I mean in practice:
-I have separate EARs if I have two applications - that is clear.
- But when I have separete JVM?:
a) In cluster enviroment: but Local interface can be used
b) when WEB and EJB container are separated: in what situation it is desired
c) other?
Thnks for answers in advance.
BTW: I looked in google first - didnt find all the answers
[983 byte] By [
jqqa] at [2007-11-26 23:16:58]

# 1
but what with stateful beans if the previous request was realized on other
machine? will it replicate? on what basis?
Generally, Stateful Session beans's state si replicated/saved at the end of a method request OR at the end of the transaction in which it participated comiits/rollsback. This way if there is a failure, the SFSB can be resurrected properly.
My question is part of a bigger one: what are the cases where I need to use >remote interface: I know "the sparate JVM or EAR" but I mean in practice:
I have separate EARs if I have two applications - that is clear.
But when I have separete JVM?:
a) In cluster enviroment: but Local interface can be used
b) when WEB and EJB container are separated: in what situation it is >desired
c) other?
If your client and EJBs are always going to be colocated (Like a Session bean calling a EntityBean), then can use LocalInterface otherwise you can use Remote interface.
What dow you mean by: If the Web and EJB Containers are separated
In Glassfish, a cluster of instances essentially contain a group of homogenous instances (meaning each instance in the cluster has the exact set of bits and hence has exact set of applications deployed). Hence each instance has both WEB and EJB Containers.
If you are talking about a setup where the WebContainer (like Tomcat) talking to another JavaEE Server (like GlassFish), the obviously you have to deploy you .war files into Tomcat (WebContainer) and then the .jar to the JavaEE Server. The replication will be handled by the respective containers.