|
From: <chr...@em...> - 2003-02-04 22:11:51
|
We should not depend on finalizers at all. As you have mentioned it might
never get called, and if it does get called you don't have any control in
wich order they are called.
The 1.3+ code should implement the shutdown hook. People that use a JVM that
does not implement the hook properly will just have to live with the unclean
shutdown I guess :( Both the housekeeper thread and the prototyping thread
are run as daemons so they should not cause any additional problems on
shutdown.
The real problem is shutting down the pool on application reloads. Our
current implementation of this has been proved to be very unpredicable, so I
think we need to document *very clearly* that all applications that expect
to be reloaded must shutdown proxool in some kind of container spesific
manner. As you mention, Servlet.destroy() is a good place to do this in a
servlet container. Most other environments will hopefully also provide
something similar (like Disposable.dispose() in a Avalon container).
We also need to be sure that shutting down Proxool several times in a row
does not cause problems. In a servlet container for example,
Servlet.destroy() will shutdown Proxool first, and then the shutdown hook
will do it again.
CHR
> -----Original Message-----
> From: pro...@li...
> [mailto:pro...@li...]On Behalf Of Bill
> Horsman
> Sent: 04 February 2003 18:17
> To: Proxool Developer List
> Subject: Re: [Proxool-developer] Bug 673073
>
>
> Hi all,
>
> A further twist: my tests with Tomcat show that the ShutdownHook works
> fine when you shutdown Tomcat. But if you simply touch the web.xml this
> causes the application to be restarted. The Servlet's destroy() method
> is called but not the ShutdownHook (which is as you might expect since
> the JVM isn't shutting down).
>
> As a consequence, it might make sense, for some people to use:
>
> public void destroy() {
> ProxoolFacade.removeAllConnectionPools(0);
> }
>
> as well.
>
> Fortunately, when you do eventually shutdown Tomcat then all the hooks
> are run so everything is eventually cleaned up. The only problem is that
> you might have more pools running than you think.
>
> > 1- Not all VM implementations apparently support the shutdownHook
> > properly. I do not have any solid evidence to this available, but this
> > is what I know I've read in places before.
>
> Maybe it is a FAQ. Q. "I have stopped my application but Proxool keeps
> running". A. "Shutdown manually."
>
> > 3- Perhaps for versions -1.3 to use this Runtime.runFinalizersOnExit
>
> But it's deprecated because it is unsafe. We *could* do that, or we
> could just advise JDK < 1.3 users to finalize manually.
>
> --
> Bill Horsman
> Proxool
> http://proxool.sourceforge.net
> ICQ: 119577180
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Proxool-developer mailing list
> Pro...@li...
> https://lists.sourceforge.net/lists/listinfo/proxool-developer
|