[EMAIL PROTECTED] wrote:
> 
> On Wed, 8 Nov 2000, William Brogden wrote:
> 
> >
> >
> > Pablo Trujillo wrote:
> > >
> > > I need to execute a procedure when a session closes. Is this possible? How
> > > it is made?
> >
> > Make a class that is a HttpSessionBindingListener - attach an
> > object of this class to the session. When the session is destroyed
> > your object will get a call to the valueUnbound method.
> 
> this is the clean way of doing it.
> you could also add some object to the session,
> and do whatever you want in the finalizer.....
> 
> Dirty, but works.
> 
> Sloot.

The problems there are that
1) you don't have any guarantee as to when the finalizer will run.
2) if there is another reference to that object hanging around,
   it will never run.

-- 
WBB - [EMAIL PROTECTED]
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

Reply via email to