- Posted by: Paddy Murphy
- Posted on: February 19 2004 13:45 EST
I am designing an application, and considering using the "Service Locator" pattern, acting as a singleton that will cache jndi context, and bean home and remote interfaces. However I am unsure whether caching of remote interface is a problem or not:
1) Under what circumstances will the cached remote interface for a stateless session bean be invalidated?
2) Under what circumstances will the cached remote interface for an Entity Bean be invalidated?
3) Assuming that I cache Stateful session bean remote interfaces in a Servlet HTTPSESSION, under what circumstances will the cached remote interface for Stateful session bean be invalidated?
4) Finally, do I have to utilise home handles instead of remote interfaces for any of these situations? If so, why?
- RE:When do remote interface get invaliated? Can I cache them? by amit damle on February 23 2004 01:44 EST
Instead of caching remote interface its always better to cache Handles.
Handles are serializable entities
There are 2 types
Home & Remote Handles
Handle handle = myEJBObject.getHandle();//where myEJBObject is remote i/f
HomeHandle = myHome.getHomeHandle();//myHome is home i/f
Regarding yr question:
Following are few scenarios where it gets invalidated