You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Oakleaf Admin <Ad...@oakleafconsultancy.com> on 2002/09/27 15:20:10 UTC

Running class finalize method when stopping/restarting a WebApp

Hi,
 
I have an application scope class that is managing an Oracle connection
cache to my database. 
 
The finalize method of this class is written to terminate all connections
and close the connection cache. 
 
However, when I stop the webapp or restart it (using the manager app) the
finalize of this class is not run everytime (about1 in every 3 times it does
run), furthermore it seems to me that Tomcat is keeping a reference to the
class as the garbage collector never closes it and Oracle DCD cannot
terminate the connection as it thinks it is still alive. 
 
Can anyone tell me how to ensure the finalize method is run everytime the
webapp is stopped/restarted or if there is any other way of doing the same
thing ?
 
Thanks in advance, Eddie