> Mike Engelhart wrote:
>
> > I have a startup servlet which initializes a connection pool (THIS IS NOT A
> > DATABASE CONNECTION POOL) to a legacy system that my webapp accesses. This
> > servlet puts a singleton connection broker into the ServletContext and is
> > shared among all my servlets. The destroy() method of this servlet then
> > ensures that all connections in the broker object are closed. My problem
> > is this:
> > I have a class which is stored in the HttpSession of the user. This class
> > implements HttpSessionBindingListener and then when the session is unbound
> > uses the startup servlet's connection pool to do some cleaning up by
> > accessing the legacy system. This is fine but when I manually shutdown the
> > server (Tomcat 3.1), the server invalidates the user sessions but this
> > occurs after the destroy() method of my startup servlet is called which in
> > effect makes the system calls to the valueUnbound() method of my class try
> > and grab a resource which doesn't exist anymore in the ServletContext.
> >
> > What I want to do is have the destroy() method wait until all the
> > HttpSession objects have been invalidated and then and only then clean up
> > the connection pool. I can't seem to find anyway to access any information
> > about server wide HttpSession's. Anyone have any ideas on how to do this??
It sounds as though you need every listener class object to 'register' with the
startup servlet. When the class completes the cleanup, it 'unregisters.' Thus
the startup servlet knows that if it still has registered objects, it should
wait before cleaning the pool. Probably easier said than done, though.
K Mukhar
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html