is it safe to store reference?
I'm new to EJB, I've read about dynamic loading in EJB to improve performance. Is it safe to store a reference to object returned by InitialContext, because I assume that InitialContext returns an object representing the "class", not the "instance"?
For example:
publicclass SomeBeanextends ...
/* ... */
private Object objRef;
/* ... */
public SomeDetail getDetail()
{
/* ... */
try{
Context jndiCtx =null;
if (objRef ==null)
{
jndiCtx =new InitialContext();
objRef = jndiCtx.lookup("Detail");
}
Detail = (Detail)
PortableRemoteObject.narrow(objRef, Detail.class);
}catch (Exception NamingException){
NamingException.printStackTrace();
}
/* ... */
}

