EJBs and Clustering

EJBs can be configured to operate in a clustered environment, leveraging WebLogic’s support for load balancing and failover. In a single-server configuration, the client uses WebLogic-specific stubs corresponding to the EJBHome and EJBObject interfaces. When you deploy EJBs to a WebLogic cluster or to multiple Managed Servers, WebLogic supplies specialized versions of the EJB home and EJB object stubs. Both of these stubs provide load-balancing and failover support, first at the level of looking up a home object, and second at the level of invoking an EJB method. As discussed in Chapter 4, any of the features of WebLogic’s clustered EJB support come directly from the operation of RMI objects in a clustered environment.

A cluster-aware EJBHome stub knows about the EJBHome objects on all WebLogic servers in the cluster. Client calls to the home stub are load-balanced between the servers to which the EJB has been deployed. The cluster-aware stub also provides failover for lookup requests by automatically routing requests to another available server in the cluster, when the original server hosting an EJB becomes unreachable. WebLogic supports clustered home stubs for all the EJB types — the home-is-clusterable element in the weblogic-ejb-jar.xml descriptor file determines whether the home object for an EJB is cluster-aware. If you specify true as the value of this setting, the EJB compiler ensures that the home stubs for the EJB are cluster-aware. By default, EJB ...

Get WebLogic: The Definitive Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.