Discussions

EJB programming & troubleshooting: can EJB Handle survive in a clustering env

  1. can EJB Handle survive in a clustering env (2 messages)

    Hi All

    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
    dso
  2. hi,

    Check out this link and see if it answers your question...

    http://www.javaworld.com/javaworld/jw-07-2002/jw-0703-service.html


    Bhagvan K
    http://www.architectcorner.com
  3. thank u for your reply. I read that article 1 yr or so ago. what the article introduce is very different my question. My question is whether a serialized EJB handle (reference by a SFSB) in other JVM can be activated, deserialized in another instance of JVM. Whether the serialized EJB handle contain any info pointing to a specific instance of EJB in original JVM. If not so, i think the SFSB / EJB handle can survive as move around in different JVMs of same cluster.
    Higly appreciate u can share with me your experience on this issue

    rgds
    dso