3 Replies Latest reply on Mar 31, 2003 1:18 PM by luwasoft

    Lost of session redeploying a servlet (Servlet.war)

    cronos

      Hi all:

      I have a problem with my servlet. The entire application ( e-commerce web page) is packed in myservlet.war.
      The servlet needs to know the session of the user in the web to handle security.
      When I build a new myservlet.war and JBoss make a new redeploy of the web, the old java objects are destroyed and the users of the web in that moment get a "session expired" because the servlet starts at point 0.

      How can I avoid the lost of the session and the process of redeploy be 'transparent' to the users , when I upload to the server a new version of the web?

      Thanks very much.

        • 1. Re: Lost of session redeploying a servlet (Servlet.war)
          lasterra

          Hola Cronos,

          I have read some time ago that this will be a feature of Jboss but i think it is not implemented yet.

          Maybe the experts could tell as somthing about this feature. BTW I think it could be a great one feature.

          Un Saludo, Enrique.

          • 2. Re: Lost of session redeploying a servlet (Servlet.war)
            cronos

            Thanks :)

            If this isn't supported it would suppose that 'Hot Deploy' is False, isn't it?
            It must have a way to do this.

            Please help to solve this problem.

            Gracias poo contestar :) crei que estaba solo en el universo.

            • 3. Re: Lost of session redeploying a servlet (Servlet.war)
              luwasoft

              The JBoss-Tomcat bundle does remember the Session even after a new *.war deployment,
              *BUT*:
              - Redeploying a war means:
              1. undeploying the old,
              2. deploying the new war.
              - The Session gets serialized at undeploy, restored at deploy, so you have to make sure that all the object you store to your session context are serializable.
              - Restoring the session will fail if the class ID's of any of the stored objects changed, means your session is only able to continue is none of the persistant session data objects class definition changed (!).
              - Your web application design should be made in a way that anything except persistant session data will be restored on request.