Please help to share yr experience on my below question about design / programming of EJB in a cluster.
As we know, the ejb remote reference is not serializable. For a stateful session bean designed to run in cluster env, hence, instance variable of ejb remote reference should not be used. Instead, it is recommneded that EJB handle is serialized. However, if an instance of server is crashed and the SFSB is created and activated in another instance of server, below statements are implemented to get back the remote reference of other ejb used within the SFSB
Object obj = myHandle.getEJBObject();
myEJB = (MyEJB)PortableRemoteObject.narrow(obj,MyEJB.class);
will above remote reference still point to an EJB instance in crashed JVM ? Or another new instance of EJB is created and pointed by above remote reference in new instance of JVM server ? If this is former case, any invocation to this new initialized remote reference will still fail. However, if it is a smart remote stub, call will be retried after locating and pointing to a new EJB created in new server. ?
Can anyone share with me how this work ?
thx & rgds