2 Replies Latest reply on Jan 30, 2002 2:16 PM by qjafcunuas

    End of Session

    qjafcunuas

      Hi,
      I'm using JBoss 2.2.2 with Tomcat 3.2.2.

      I've a servlet calling a stateful session bean.
      When my client connects to the application, i open a session, and modifies some data in the DB.
      When my client disconnects, i remove the session bean, and invalidate session.
      My SessionBean.ejbRemove method updates data in the DB.

      When there is a problem on my client (close the browser without disconnecting for example), the server close the session automatically, after 30 minutes.
      The trouble is that SessionBean.ejbRemove method isn't called, and data in DB are not modified.

      How can i do to call SessionBean.ejbRemove when the server close automatically a session.

      Thanks for your help,
      Bruno

        • 1. Re: End of Session
          seven

          http://www.onjava.com/pub/a/onjava/2001/03/22/servlets23.html?page=1

          There is a snapshot from the summary:
          --------------------------------------------
          The two biggest additions to the specification are application lifecycle events and filters. Application lifecycle events give Web Application programmers greater interaction with the ServletContext object and the HttpSession objects. The filters allow the Web Application developer to transform the content of an HTTP request or response or modify header information.
          ---------------------------------------------
          So it shoul work. I did't try it, but as long as tomcat4.0.1 implements Servlet 2.3 specification, u should be able to intercept session timeout and from there call ejbRemove.

          • 2. Re: End of Session
            qjafcunuas

            thank you for your answer
            Bruno