1
votes

I would like to know that how EJB session bean pool works in clustered environment, suppose if there are three clustered nodes and one node goes down then how the session beans pool will be replicated and same request operation will be continued on the other node. Thanks, Shailendra Singh

2

2 Answers

4
votes

It is a little hard to answer your question because I think you need more background about Cluster, but I will try...

One of the main motivation for building a cluster is to give to your application a propertie called High Availavility, which is the possibility that a system continues working although a hardware failure occurs or a maintenance task (e.g. to update new software version) needs to be done.

The easiest way to achieve this is to use Load Balancing which means that when a cluster's node fails, the incoming requests will be managed by the others actives nodes.

Specifically talking about EJB services; load balancing is accomplished by the EJB client' Stub, the Stub has a list with the cluster node's IP. Every time a client needs to make a request, the Stub selects an IP from the list. If a node fails, his IP will not be available until the node recovers.

As you can see, there is not data replication between nodes, just load balancing. (the EJBs are not aware of this process)

If the Cluster is heterogeneous, the things are more complicated due to the fact that the client needs a service called HA-JNDI to lookup the Stub.

Some applications (the vast minority) need special requirements, therefore, load balancing sometimes is not enough; e.g. when a node fails, the new node that will process the next client's request, has to know the information state that the broken node was managing. This can be done if the information was previously replicated in at least other cluster's node. When you add state replication, your application is Fault Tolerance.

This state replication is done by a special appserver's component called Distributed Cache, as developer, your main responsibility is to tell the appserver which information (service) needs to be replicated, how often, etc.

I hope this help you as a starting point for next readings.

note: EJB pool is other appserver service and is not related to Cluster.

0
votes

Clustered EJBs have failover capability. The state of the @Stateful @Clustered EJBs is replicated across the cluster nodes so that if one of the nodes in the cluster goes down, some other node will be able to take over the invocations.

for more info visit link