RE: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-19 Thread Brian.Horblit
ginal Message- -->From: [EMAIL PROTECTED] -->[mailto:[EMAIL PROTECTED] -->Sent: Wednesday, September 19, 2007 5:05 AM -->To: Tomcat Users List -->Subject: Re: How do you access all sessions from a servlet -->in tomcat 6.0? --> --> -

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-19 Thread Lyallex
On 9/19/07, David Delbecq <[EMAIL PROTECTED]> wrote: > Just use WeakReference :) Er, well that's OK, the WeakReference referant object (the session) is null after gc but now I have a WeakReference object lurking in my Map as opposed to the HttpSession object previously so I'm not really gaining a

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-19 Thread gary . l . johnstone
Thanks for all the feedback on this. ___ Gary Johnstone Engineering IT Cummins Turbo Technologies Ltd +44 1484 440532 Lyallex

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-19 Thread David Delbecq
Just use WeakReference :) Lyallex a écrit : OK, for some reason I've been obsessing about this for a whole day now. If you hold an external reference to a Session then according to my tests the session will still time out as expected but the external reference will be non null. At the very leas

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-19 Thread Lyallex
OK, for some reason I've been obsessing about this for a whole day now. If you hold an external reference to a Session then according to my tests the session will still time out as expected but the external reference will be non null. At the very least this means that you may end up with a large n

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread Lyallex
On 9/18/07, Lyallex <[EMAIL PROTECTED]> wrote: > How about creating a SessionListener > > class SomeSessionListener implements HttpSessionListener ... > > Register it in web.xml > > in the sessionCreated method of your listener get a reference to the > new session from the HttpSessionEvent you can

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread Lilianne E. Blaze
Just be aware it will get messy if the webapp is distributed. One suggestion - don't configure the sessions for 12h maxInactiveInterval. Keep the default 30m (or was it 15m? whatever), and change it to 12h only after login. Otherwise guest-sessions will expire in 12h too, and that's just wasteful.

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread gary . l . johnstone
Thanks Duncan after a quick read on session listeners that looks like it will do the trick. Gary ___ Gary Johnstone Engineering IT Cummins Turbo Technologies Ltd +44 1484 440532 _ This e-mail transmission and any attachments to it are intended solely for

Re: How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread Lyallex
How about creating a SessionListener class SomeSessionListener implements HttpSessionListener ... Register it in web.xml in the sessionCreated method of your listener get a reference to the new session from the HttpSessionEvent you can now access the getLastAccessedTime(), maybe store the refs i

How do you access all sessions from a servlet in tomcat 6.0?

2007-09-18 Thread gary . l . johnstone
We have tomcat configured to allow users sessions to stay alive for 12 hours. This is because this is how they like to work, login once at the start of the day and shutdown at the end of the day. I have a need to track their actual activity, like a concurrent license tool, and thought the best w