On Mon, 15 Apr 2002, Daniel Aborg wrote:

> Date: Mon, 15 Apr 2002 14:07:40 +0100
> From: Daniel Aborg <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: Tomcat 4.0.3 hangs when removing web application.
>
> Craig R. McClanahan wrote:
> >>Here is a simple example which reproduces this behaviour:
> [snip]
>  >>In my eyes, this should work without any problems. (It does work just
>  >>fine in Tomcat 3.2.2.)
>
> > No, this should not work -- and Tomcat 3.2 was broken in allowing it.
> >
> > Per the servlet spec, the container is not allowed to call destroy() if
> > any requests are currently active.
>
> Doh.  That explains it.  Alright.
>
> So, what choices are you left with if you want to do something like
> this?  Adding a shutdown hook to the servlet container which asks the
> servlet to release its connections?
>
> Thanks for your help!
>

Such a hook was indeed added in Servlet 2.3 (and is therefore supported by
Tomcat 4).  Check out the contextDestroyed() method of the
ServletContextListener interface, which you can use to clean up resources
as an application is being shut down.

> /D
>
> --
> Daniel Aborg - Developer

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to