12 April 2007 - 15:34Caching remote EJB Homes

Remote EJB Homes should be cached because in order to instantiate one you need to create a context binding to the server hosting the remote EJB home. The context creation is a pretty heavy operation (involves among other things checking security certificates, etc…) so it should be minimized. The fact that you are dealing with remote EJB Homes raises the possibility that the server hosting those homes can get restarted, etc… Your cached EJB home will be stale once this happens. This should be avoided, the cached EJB Home should be re-instantiated on such exceptions according to some fail-over policy.
A possible interesting use for AOP.

No Comments | Tags: Things for me

Add a Comment