Feb 5th, 2013, 03:56 AM
Spring context is destroyed immediately on shutdown without waiting jobs to complete
I have a spring application with many scheduled quartz jobs in it. When tomcat's shutdown.sh file is executed tomcat stops. However, I want all my jobs to complete their execution, then I want application server to stop.
That works fine, all executing jobs finishes their jobs before server shuts down. However, Spring context is destroyed when I execute shutdown.sh. So any kind of DB operations etc. processes can not be done with cause NoClassDefFoundError.
How can I handle this situation? I want Spring context to be destroyed after my quartz jobs finish their execution.