posted 20 years ago
I might start reminding you that programmers needs to first look up the bean�s home interface into the JNDI in order to get a reference to the bean�s remote interface. WebLogic will cluster all of these : jndi, home interface and remote interface. The server provides a cluster-wide jndi namespace, where each server maintains its own copy of the cluster-wide (or global) jndi. Changes to the global jndi are propagated to each server using the IP-multicast protocol. This is the mean by which WebLogic achieves location transparency: programmers never know to which server in the cluster they are actually connected in order to look up the home interface.
The remote interface is nothing but a client stub for proxying RMI request to the server stub. In a clustered environment this stub (known as a cluster-aware stub, or replica-aware stub) maintains a list of all servers in the cluster. If a server goes down, it is removed from the stub�s list, until the server will start up again. By default the stub uses a round-robin algorithm in order to forward requests to the next server instance in the cluster. Generally soaking this would apply to every RMI object deployed in a clustered environment.
The clustering mechanism is little bit different for each type of enterprise bean. For SFSB(s), WebLogic uses the same in-memory replication logic as for replicating the HttpSession objects. Therefore the stub will maintain only the address of the primary and secondary instances and won�t care much about all other servers in the clusters (unless the primary goes down and a new primary is picked, etc).
For the SLSB(s) WebLogic uses the mechanism explained above. However there is one more difference: the methods declared in the home interface stub are idempotent (the idempotent behavior could be enforced through deployment descriptor flags, or by runnining the rmic compiler passing the right parameters, etc). All other types of home interfaces are not idempotent.
Entity beans are also little bit different, because these stubs use a �sticky� routing algorithm. This means that the server will do everything it can in order to route client requests to the same server instance in the cluster. The reason behind this is mainly for improving the caching capabilities of the server and to reduce transaction propagation across the instances in the cluster.
I think, therefore I exist -- Rene Descartes