The following figure shows the procedure by which the naming is cached.
Figure 2-12 Procedure of caching in naming
![[Figure]](figure/zu021200.gif)
The following is a description of the caching procedure. In this procedure, the EJB home object references with the same name 'Count' are looked up from two J2EE applications on the same J2EE server. The points 1 through 5 indicate processing executed from the J2EE application 1 and points 6 through 9 indicate processing executed from the J2EE application 2.
- J2EE application 1 generates an instance of the JNDI javax.naming.InitialContext class.
- J2EE application 1 requests a search (lookup) of the EJB home object references for the instance of the javax.naming.InitialContext class. At this time, 'Count' is specified in the name.
- The naming management functionality that receives the request searches the EJB home object references from the name space of the CORBA Naming Service.
- The naming management functionality obtains the EJB home object references as the search results.
- The naming management functionality stores the obtained EJB home object references in the cache.
- J2EE application 2 existing on the same process generates the instance of the JNDI javax.naming.InitialContext class.
- J2EE application 2 requests a search (lookup) of the EJB home object references for the instance of the javax.naming.InitialContext class. At this time, the same name 'Count' as that in 2 is specified as the name.
- The naming management functionality that receives the request searches the EJB home object references from the cache.
- The naming management functionality obtains the EJB home object references from cache as the search results.