We have a service Locator that does all JNDI lookups for a session bean.
Now we want to put a caching mechanism to save us from doing the JNDI look up again and again.
1. Can we cache the home interfaces of both Session and Entity Beans ? I mean is there a potential problem of doing it this way.
2. This caching is done by caching the handle generally , is there a different way of doing it?
What ever you want to do is a one of the Patterns specified by Sun . It is called as Hook Pattern .
For details visit java.sun.com
I couldn't find a reference to the "Hook" pattern on java.sun.com. Is it the same/similar to the "Service Locator" pattern?
Service Locator pattern talks about caching at client end but if you look at Application Server - e.g. WebSphere, it has provided certain properties for caching !! (I couldn't find same in weblogic though both of them implement JNDI)
--> one of the other points which I am just wondering is by using Singleton we are avoiding Object overhead but at the same time all the simultaneous request for context have to wait ???