4 Replies Latest reply on Mar 5, 2013 12:50 AM by ashvish

    getHandle() equivalant in EJB3

    m_pat

      Hello All,

       

      I am trying to migrate an ejb 1.1 app from weblogic to ejb 3.1 JBoss 7.1, and I am currently trying to find the equivalant of the getHandle() call for EJB3 spec.

       

      In the 1.1 app the handle is serialized to file, in the event that the client lost their connection to the server, the handle is deserialized and used to connect to the same session bean which will be in the same state it was last left at instead of starting from scratch.

       

      The getHandle() is not available in the EJB3 spec, is there another equivalant of this?

       

      I have tried serializing the remote proxy, but it didn't help.

       

      Is there a work around for this issue.

       

      ta.

        • 1. Re: getHandle() equivalant in EJB3
          m_pat

          Isn't there anybody on the forum who can help me with this problem, has somebody else come across this issue before and managed to work around it?

          • 2. Re: getHandle() equivalant in EJB3
            ashvish

            Hello, I am also looking for a solution for the same problem, have you found any solution yet?

            • 3. Re: getHandle() equivalant in EJB3
              m_pat

              Yes I did find the solution, my apologies for not updating the this thread. Basically there is no need to do anything special, in EJB3 you can simply serialize the remote object directly, i.e.

               

              ObjectOutputStream out =

               

              new
              ObjectOutputStream(new FileOutputStream(serFile));

               

              out.writeObject(remote);

              out.close();

               

               

              And then to deserialize simply read it it again, i.e.

               

              ObjectInputStream in = new ObjectInputStream(new

              FileInputStream(serFile));

               

              RemoteBean rem = (RemoteBean) in.readObject();

              • 4. Re: getHandle() equivalant in EJB3
                ashvish

                Hi Mukhtar,

                 

                Thanks for your reply. For serialization the remote interface need to implement the Serializable interface or not? Also I wonder whether the remote object can be stored in HttpSession as an attribute.

                 

                Thanks

                Ashok