java - shutdown hook in tomcat (necessary) not running -
I have a long running CPU and database intensive thread (which runs on low priority), which is my Tomcat application manager by request.
I use a shutdown hook for this thread, so that if the application ceases forcibly, it can clear the database position before exiting. Works entirely in standalone mode, with Control-C and Canceling in Eclipse Console.
But when I'm undergoing Tomcat, and when I do this:
$ CATALINA_HOME / bin / shutdown.sh
I verified with debug logging I have done that the message that my chopped off is sent by Tomcat, but there is no way that the message can stop it, and the important thing is that my shutdown hook never fire. / P>
I have seen other people that people who used the reference had seen, but this would not work for me, and some questions and answers also show that the shutdown hook works for them in Tomcat.
Using Tomcat 6.0.35
I have a long running CPU and database intensive thread that runs on less commonality ) Which can be removed by an administrator request by my Tomcat application.
Why not go out of this process and do not bother with webapp, context event, shutdown, hook or any of the rot?
Shu tilt hook is a hip, and as @Stefenk says, they will not fire when you want them.
Comments
Post a Comment