tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kief Morris <k...@bitbull.com>
Subject Re: Trouble with session object
Date Tue, 30 Jan 2001 15:15:29 GMT
Ivo Limmen typed the following on 03:58 PM 1/30/2001 +0100
>I created an object that tracks the amount of sessions and can refer to any
>of them if needed be. It uses a weak reference to make it possible that
>Tomcat can still drop a session if a user leaves the server. The trouble is
>Tomcat doesn't drop any sessions! It can't be because I have a reference to
>the session because I use a weak reference to them.
>Does anybody know a sollution to be able to refer to a session object only
>if they are in use?

Tracking sessions is a bit tricky, because Tomcat (like other servlet engines)
pools session objects: after the user's session is done, the session object's
data is cleared and it is put on a list to be reused for later users. This helps
make Tomcat much faster than it used to be, but does make tracking sessions
tricky. Look into using the Listener interfaces in the Servlet 2.2 API (Tomcat 3.2)
or Servlet 2.3 API (Tomcat 4 - which is currently in development).

Kief


Mime
View raw message