java - J2EE/EJB + service locator: is it safe to cache EJB Home lookup result? -
in j2ee application, using ejb2 in weblogic.
to avoid losing time building initial context , looking ejb home interface, i'm considering service locator pattern.
but after few search on web found if pattern recommended initialcontext caching, there negative opinion ejb home caching.
questions:
- is safe cache ejb home lookup result ?
- what happen if 1 cluster node no more working ?
- what happen if install new version of ejb without refreshing service locator's cache ?
is safe cache ejb home lookup result ?
yes.
what happen if 1 cluster node no more working ?
if server configured clustering/wlm, request should silently failover server in cluster. routing information encoded in stub ior.
what happen if install new version of ejb without refreshing service locator's cache ?
assuming update bean , not component or home interfaces, continues work. ejbhome stateless session bean, request can continue accessed same server if available or on different server in cluster if not.
note @ejb injection in ejb3 encourages home caching. (though, admittedly, allows sfsb caching though incorrect, perhaps @ejb isn't best support of claim :-)).
Comments
Post a Comment