Best Practices

Every remote JNDI lookup is an expensive remote method call, and in order to perform JNDI lookup, it is optimum for applications to do it once (usually at the component initialization). Therefore, caching the home handles improves the performance in such situations. Establishing a connection to a JNDI service is also an expensive task, and caching such context references improves application performance.

Use one class to abstract all JNDI usage and to hide the complexities of initial context creation, EJB home object lookup, and EJB object re-creation. Multiple clients can reuse such objects to reduce code complexity, provide a single point of control, and improve performance by providing a caching facility.

An object stored in a JNDI tree must implement either the java.io.Serializable or java.rmi.Remote interface. Both WebLogic and JBoss use nonpersistent JNDI service. This in-memory caching technique increases the performance of retrievals. To increase the reliability of these services, vendors rely on replicating them across all the nodes of a cluster. This provides both fail-over and load balancing of the naming services. In a clustered JNDI service, each node propagates the JNDI changes that occurred due to binding, rebinding, and unbinding through IP multicast to other nodes of the cluster.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.31.67