Bug 19 : Shutdown hook not removed - issue for tomcat reload
Priority 
Medium
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.3
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
23/06/2007
Updated 
23/06/2007
Type 
Bug
 
Attachments 
No attachments

Hello,

Unfortunately I cannot login to your site atm, so i'm sending this via email:
When reloading an application in tomcat, the JVM is not stopped, so shutdown hooks won't be called. As you register a new shutdown hook statically, they will _all_ be called when finally stopping the tomcat instance.

I do a com.avaje.lib.ShutdownManager.shutdown(); in the servlets contextDestroyed method, so all threads are already closed, but the hook won't get removed. i just made "hook" a static variable, and added Runtime.getRuntime().removeShutdownHook(hook); in the shutdown() method.

This fixes the bug for me.

so long and best regards,
-erwin

 
Rob 23 Jun 10:20
Makes sense

Yes, this makes sense to me. I'll put this fix into 0.9.3.

woResponse

Upload a file