Thanks Karl. That worked out great. When I set jrun not to use the session
store for that app, valueUnbound was indeed called when jrun was restarted.
It would have worked the other way too when sessions were restored (if the
session store was used), but the session store was not working properly for
me to begin with (I think it was fixed only in SP2 and I don't have that
yet).
Cristian
> Date: Mon, 05 Feb 2001 16:43:14 -0500
> From: Karl Moss <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: RE: tracking sessions with HttpSessionBindingListener
> Message-ID:
> <[EMAIL PROTECTED]>
>
> If you have session persistence enabled
> (session.persistence=true), which is
> the default value, then when the JRun server is stopped all
> active sessions
> are not destroyed, but persisted. When the server starts back
> up they are
> restored to an active state where they can be reused or
> eventually timed
> out. You can find more info at
> http://www.allaire.com/handlers/index.cfm?ID=17454&Method=Full.
>
> If you want all active sessions to be destroyed when the
> server is shut
> down, set session.persistence=false.
>
> BTW, the Servlet 2.3 specification will introduce Application
> Lifecycle
> Events which will accommodate exactly what you are trying to
> do. With this
> new API you can create a HttpSessionListener which will
> receive events when
> a session is created and destroyed. For more info, see
> Chapter 10 of the 2.3
> proposed final draft of the spec at
> http://java.sun.com/products/servlets.
>
> Hope this helps,
>
> Karl Moss
> Allaire, Corp.
>
> -----Original Message-----
> From: Cristian Satnic [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 05, 2001 4:21 PM
> To: JRun-Talk
> Subject: tracking sessions with HttpSessionBindingListener
>
>
> I am trying to use the HttpSessionBindingListener interface to track
> sessions which are created or destroyed in jrun. This is
> useful in keeping
> track of logged in users for an app.
>
> As you know, this interface defines two functions, valueBound and
> valueUnbound, which are called when an object that implements
> HttpSessionBindingListener is added or removed from a session.
>
> It works fine (especially the valueUnbound part) as long as
> the session is
> invalidated or timed out. But, if jrun is stopped or restarted,
> valueUnbound is not called anymore. So, any sessions that
> would still exist
> at the time of the restart would die without letting the
> tracking object
> know about it.
>
> Should jrun call valueUnbound when it is stopped? I am not
> too familiar
> with the servlet 2.2 spec - is it up to the app. server
> providers to decide
> what to do in this case? The way it is now, it is only 70-80% useful.
> There are cases (restart) which don't allow me to clean up.
>
> Thanks.
> Cristian
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Structure your ColdFusion code with Fusebox. Get the official
> book at http://www.fusionauthority.com/bkinfo.cfm
>
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists