3 Replies Latest reply on Dec 4, 2007 12:59 PM by ryoung2504

    how does Seam/EJB determine session expiration?

    asookazian

      I've noticed this happens when I close my IE browser (the session data is no longer available when I re-run my app/test case).

      so how does Seam/EJB3 handle this for a SFSB??

        • 1. Re: how does Seam/EJB determine session expiration?
          pmuir

          I believe this information is provided by Tomcat (Servlet API).

          • 2. Re: how does Seam/EJB determine session expiration?
            asookazian

            running jboss 4.2.2.GA with Seam2.0.0.GA.

            1) started JBoss and deployed my Seam app.

            2) navigated to JBoss web-console via following URL: http://localhost:8080/web-console/ and navigated to monitoring --> web status --> full status

            3) checked active sessions and session count for my app were both zero.

            4) launched IE browser and navigated to following URL: http://localhost:8080/securityAudit/

            5) launched IE browser again and navigated to same URL as step 4.

            6) refreshed web-console

            7) results:

            localhost/securityAudit
            Start time: Tue Dec 04 08:50:07 PST 2007 Startup time: 31 ms TLD scan time: 0 ms
            Active sessions: 2 Session count: 2 Max active sessions: 2 Rejected session creations: 0 Expired sessions: 0 Longest session alive time: 0 s Average session alive time: 0 s Processing time: 0 ms
            JSPs loaded: 0 JSPs reloaded: 0

            8) closed both IE browsers and refreshed the full status in web-console.

            9) results (the same as step 7):

            localhost/securityAudit
            Start time: Tue Dec 04 08:50:07 PST 2007 Startup time: 31 ms TLD scan time: 0 ms
            Active sessions: 2 Session count: 2 Max active sessions: 2 Rejected session creations: 0 Expired sessions: 0 Longest session alive time: 0 s Average session alive time: 0 s Processing time: 0 ms
            JSPs loaded: 0 JSPs reloaded: 0

            So it seems the sessions are still active obviously... The other reason I know is that the prePassivate output in the log does not occur when I close the browser(s).

            HTTP is a stateless protocol and this experiment proves it... When I restart the JBoss server, the session count goes to zero again...

            • 3. Re: how does Seam/EJB determine session expiration?
              ryoung2504

              You'll need to pause before running step 9 (for at least the session timeout period since step 5).
              Closing of browsers (or navigation off-site) will not send anything back to the server, thus the only way to determine if a session is over (without hitting specific urls on the server) is a timeout.
              Your figures in step 9 should then be different.

              Seam (and any other server side code) will then handle the passivate code, @Destroy code on @Statefuls etc.

              You may find this timeout to be 30mins.