2 Replies Latest reply on Aug 31, 2004 5:55 PM by Jared Rodriguez

    Local Session Bean Failover

    Jared Rodriguez Newbie

      Using local stateful session beans accessed from the web layer creates a serialization exception when the cluster moves across session data. I can use the remote version by using Handles and reconnecting to the stateful session beans from the Handles, but I would like to get the locals and use them instead since there is less overhead and faster access. Is there any way around this?

      Jared

        • 1. Re: Local Session Bean Failover
          David Orriss Jr Newbie

          Interesting... I'm actually having problems figuring out how to handle failover in JBoss with *remote* access to SFSBs. Can you point me to a code example somewhere so I can try and fix *this* part? Perhaps we can then put our heads together to solve the local interface access problem (tho I think I might already know what your problem is - just not sure).

          Hope to hear from you soon.

          • 2. Re: Local Session Bean Failover
            Jared Rodriguez Newbie

            For failover at the web layer I created an object I call SessionCache, which I store in the use session.

            public class SessionCache implements Serializable {
            private transient Hashtable sessBeans = new Hashtable();
            private Hashtable sessHandles = new Hashtable();

            public SessionBean getSessionBean (String name) {
            SessionBean sb = null;
            Handle hh = null;
            if ((sb = (SessionBean )sessBeans.get (name)) == null) {
            if ((hh = (Handle )sessHandles.get(name)) != null) {
            sb = hh.getEJBObject();
            } else {
            // make session bean here
            }
            }
            return sb;
            }
            }

            Hope this helps,

            Jared