2 Replies Latest reply on May 10, 2002 2:19 AM by Richard Kilgore

    stateful SessionBeans and the HTTP session

    Richard Kilgore Newbie

      Does a SessionBean stay available when an EJB application
      is re-deployed? I have been trying to store a SessionBean
      in an HTTP session, and it seems that the SessionBean
      becomes unavailable when the application is undeployed,
      and then I get problems saving and restoring the HTTP
      session (which is saved before and retrieved after an
      application redeploy -- even after a JBoss restart, I
      think).

        • 1. Re: stateful SessionBeans and the HTTP session
          Sebastian Hallensleben Newbie

          The SessionBean cannot really stay available after redeployment - JBoss would have to maintain two versions of the EJB in parallel to achieve something like that. The typical error message I get when trying to reuse a stale bean instance from a servlet is "Method not found".

          Not sure about your HTTP session issue - are you sure JBoss persists the session information to disk to survive shutdown/startup?

          /Sebastian

          • 2. Re: stateful SessionBeans and the HTTP session
            Richard Kilgore Newbie

            > The SessionBean cannot really stay available after
            > redeployment - JBoss would have to maintain two
            > versions of the EJB in parallel to achieve something
            > like that. The typical error message I get when
            > trying to reuse a stale bean instance from a servlet
            > is "Method not found".
            >
            > Not sure about your HTTP session issue - are you sure
            > JBoss persists the session information to disk to
            > survive shutdown/startup?
            >
            > /Sebastian

            I'm not certain about the shutdown-startup, but
            definitely after a redeploy it reloads the HTTP
            sessions. I had to replace all my component interfaces
            with wrappers that keep the interface as a transient
            variable and the primary key for serialization and
            then re-invoke findByPrimaryKey() whenever needed.
            Now everything is happy, and I never get crashes
            anymore (unless I use IBM's JVM for Linux, in which
            case I get a ClassFormatError every few re-deploys
            for some reaosn).