Is it safe to cache EJB Home lookup result ? What will happen if one my cluster node is no more working ?
IMHO The goal of ServiceLocator in J2EE is to cache EJB Home and reduce costly JNDI searches. This is safe in Weblogic, because by default EJB Home is load balanced in the cluster, and this will automatically allow the transition to the next server.
This value is controlled by the value of home-is-clusterable in weblogic-ejb-jar.xml, documented here , which defaults to true .
What will happen if I install a new version of the EJB without refreshing the service locator cache ?
I did not even try to make such a change myself. However, I assume that part of your build / deployment, your Service Locator class will also be redistributed along with modifying your EJBs - and therefore make a new search?
If your client is not affected during changes to the EJB, the cached EJBHome will return the legacy link when you call the method on it. Therefore, you will have to force the client to upgrade.
JoseK source share