This sub-section describes the notes related to caching of naming.
- We recommend that you disable the caching in naming when the EJB home object references and the JDBC data source are cached in the application.
- To clear the cache periodically, specify the settings in the Easy Setup definition file. Specify the following parameters in the <configuration> tag of the logical J2EE server (j2ee-server):
- ejbserver.jndi.cache.interval.clear.option
- Specifies the range for clearing the cache.
- ejbserver.jndi.cache
- Specifies whether to execute the cache. Specify 'ON'.
- ejbserver.jndi.cache.interval
- Specifies the cache-clearing interval.
- If check is set in the property ejbserver.jndi.cache.interval.clear.option in the <configuration> tag of the logical J2EE server (j2ee-server), the CORBA Naming Service is monitored only at the cache-clearing time specified in the property ejbserver.jndi.cache.interval. After the CORBA Naming Service restarts, the value specified in the property ejbserver.jndi.cache.interval is the maximum time required for detecting the recovery of the CORBA Naming Service.
- When you use the caching functionality, if the J2EE server that holds the EJB home objects is down or if the J2EE application is redeployed when the cache contains stored EJB home object references, the object references of the EJB home object stored in the cache become invalid. In this condition, if a search request (lookup) for an EJB home object is received, the invalid object references in the cache are returned to the requester. If methods such as the javax.rmi.PortableRemoteObject.narrow()or create methods are executed for such object references, a CORBA exception (such as org.omg.CORBA.OBJECT_NOT_EXIST) might occur. Note that when a CORBA exception occurs, all the cache information is deleted. In the next search request (lookup), valid information is obtained by connecting to the CORBA Naming Service.
- When the CTM is used and if only the invalid cache area is cleared at the specified interval, the object references of the EJB home object in the global CORBA Naming Service are not cleared from the cache area even if the J2EE server and J2EE application are stopped. If a search request (lookup) for the EJB home objects is received, the un-cleared object references on the cache return to the requester. If the J2EE application is restarted, the cached object references can be used as are. If the J2EE application is not restarted and if you execute a method such as the create method for the returned object references, a CORBA exception (org.omg.CORBA.NO_IMPLEMENT) occurs.
Note that if a CORBA exception occurs, all the cache information is deleted. If the J2EE application is restarted, valid information is obtained by connecting to the global CORBA Naming Service in the next search request (lookup).
- If the J2EE server is restarted by setting the ejbserver.jndi.cache property to "on" while a business interface is being used, a javax.ejb.EJBException might occur when a business method is executed.
Note that if a javax.ejb.EJBException occurs, valid information will be acquired by connecting to a CORBA naming service the next time a lookup request is made.