This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown " Watch "Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown " New topic
Author

Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown

Jacob Tom
Greenhorn

Joined: Mar 06, 2013
Posts: 5
Hi,

As per the documentation of property "waitForJobsToCompleteOnShutdown" within "org.springframework.scheduling.quartz.SchedulerFactoryBean", Spring should wait for running jobs to complete before shutdown.

I have configured the scheduler in spring configuration xml as shown below -


I also have configured correponding trigger and job. Then I am scheduling the job using the scheduler.

This Spring module is deployed on weblogic 8.1.

When a 'shutdown' is issued from weblogic, it appears that weblogic does not wait for the spring job to complete before shutdown even though 'waitForJobsToCompleteOnShutdown' is set to TRUE.

Could you please advice what could be wrong?

Please let me know if you need any more details.

Regards,
Jacob
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Is Weblogic issuing a graceful shutdown to the Spring context? It is the context closing event that handles this, it has nothing to do with Weblogic. You can test this by running it in a standalone application and calling close on the context. If Weblogic won't wait there is nothing you can do.


[How To Ask Questions][Read before you PM me]
Jacob Tom
Greenhorn

Joined: Mar 06, 2013
Posts: 5
Thanks Bill for reply.

Weblogic is issuing graceful shutdown. Please find below class that extends "ContextLoaderListener". Is there anything I need to do more in the "contextDestroyed" method to ensure that weblogic waits till all my currently running jobs are finished before shutting down?



Regards,
Jacob
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring(version 2.5)+ Quartz - SchedulerFactoryBean - waitForJobsToCompleteOnShutdown
 
Similar Threads
Inconsistent behaviour by Spring Quartz Scheduler.
Spring and Quartz - can't update Triggers in database
Migrating from Spring 2.0 and Hibernate 3.0 to Spring 3.1 and Hibernate 4.1
Restrict quartz scheduler to single instance.
Quartz1.6.4 - how to maintain state after system/application restart