7 Replies Latest reply on Jun 7, 2007 2:40 PM by ablevine1

    session persistence and cluster cache (4.0.3 SP1)

    pgpnet

      My http-sessions are not persisted when stopping web-applications in cluster-config.

      I have configured JBoss 4.0.3 SP1 with 2 cluster nodes configuration "all".
      Added to tomcat's context.xml this line:

      <Manager pathname="SESSIONS.ser" />


      Now I stop my webapp on 1 node, the sessions for this context are gone.
      After starting this webapp again, a new session is created.

      I want to restart or redeploy my webapps with session serialization.
      JBoss 4.0.1 worked.

      Now JBoss 4.0.3 throws my session out of TreeCache when stopping a webapp.

      Please help.

        • 1. Re: session persistence and cluster cache (4.0.3 SP1)

          I don't think we support passivation of clustered web app yet. Are you sure 4.0.1 was working before? Or am I misunderstood?

          -Ben

          • 2. Re: session persistence and cluster cache (4.0.3 SP1)
            pgpnet

            Ok, I'm wrong, passivation of a clustered web app doesnt' work!

            But the cluster-cache behavior is different from 4.0.1 to 4.0.3.
            * 4.0.1: When restarting/redeploying webapps, the session is still valid in cluster cache. Customers can finish their work without problems.
            * 4.0.3: Session is lost after restart/redeploy

            I've found one important difference between 4.0.1 and 4.0.3.
            * 4.0.1 stores the session in cluster cache in path /JSESSION.
            * 4.0.3 in path /JSESSION/localhost/context

            I think, if context is stopped or removed on 4.0.3, the session is also removed. But only on one node!
            4.0.1 doesn't remove the session.

            If I stop the application on only one(!) node and printDetails from TomcatClusterCache JMX-bean, the session was removed only on this node. printDetails on the other nodes with running webapps still find the session.

            Now if I start the webapp on the first node again, my cluster session is gone and a new version is started and replicated in cluster cache.

            Btw:
            I've written a simple test-servlet that counts each request and stores the counter in http-session. Try to restart such a servlet (all nodes) in cluster environment. 4.0.1 works. 4.0.3 not.

            • 3. Re: session persistence and cluster cache (4.0.3 SP1)
              ablevine1

              does this mean that in newer versions of jboss (4.0.5 and 4.2.0), that if I have a clustered web app and set the following in context.xml

              <Manager pathname="SESSIONS.ser" />
              

              that when I stop jboss the sessions will not be serialized to the SESSIONS.ser file and deserialized upon the next startup??? If this does not currently work, are the plans to implement this functionality in the future?? Its rather important because while my webapp is clustered across servers, whenever I update it, all of the current sessions are lost. Is ther perhaps another solution to this problem??

              • 4. Re: session persistence and cluster cache (4.0.3 SP1)
                brian.stansberry

                Passivation of distributed sessions will be supported in AS 5.

                • 5. Re: session persistence and cluster cache (4.0.3 SP1)
                  ablevine1

                  That is rather unfortunate as it poses a bit of problem for my company in that, when we upgrade our production ear, our sessions are lost. Is there another way around this issue?? Currently we distribute the war to our 3 app servers in a staggered fashion, allowing for about 2 minutes in between the dist to each server in order to allow for the app to restart, but we still occasionally lose sessions. Would using farming instead of our own distribution technique take care of this problem??

                  • 6. Re: session persistence and cluster cache (4.0.3 SP1)
                    brian.stansberry

                    No, it would make it worse, as you'd end up restarting the app at the same time on all the nodes. The way you do it, the replicated cache itself provides a backup.

                    • 7. Re: session persistence and cluster cache (4.0.3 SP1)
                      ablevine1

                      Brian. Thanks for your quick responses. Any time estimate for when JBoss 5 should be out??