File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring and Quartz - can't update Triggers in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring and Quartz - can Watch "Spring and Quartz - can New topic
Author

Spring and Quartz - can't update Triggers in database

Aaron Mirsky
Greenhorn

Joined: Dec 07, 2010
Posts: 6
I am relatively new to Spring and even newer to Quartz. I have been learning the technology but have run into a wall with Quartz.

Basically I am using a Quartz scheduler that persists all the jobs/triggers/etc on a database. Everything is find and dandy. Runs as expected. However if I need to change the schedule of a Trigger (lets says from eveny 2 seconds to every 5 second). The issue is that changing the repeatInterval value in the bean does not change in the database (Even if i restart the server [don't yet have a need of any dynamic stuff]). So the Trigger still fires every 2 seconds. The only way I was able to change it was by directly deleting the Tigger from the database - which to me is obviously not the best or only way to do it?

Does any one have any insight on what I am missing? My test servlet which is having the problem is pretty simple. I just have one HelloJob such prints "Hello" to console plus the current time.

Thanks in advance!

Here are da'beans:

Aaron Mirsky
Greenhorn

Joined: Dec 07, 2010
Posts: 6
Any takers?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

BeForthrightWhenCrossPostingToOtherSites. (Spring Forum)


[My Blog]
All roads lead to JavaRanch
Aaron Mirsky
Greenhorn

Joined: Dec 07, 2010
Posts: 6
Sorry about that.

Posted first on Spring and then later on Terracotta(Quartz) when no solution was found. Then here when didn't any response from Terracotta.

Today I did happen to get a response on Terracotta that this issue is an unfortunate quirk in Spring that conflicts with Quartz. The best way to go about things is by using the Scheduler's getTrigger() and then rescheduleJob() methods.

I was not given a hint of how or where to do this but I have now figured it out. I extended the spring SchedulerFactoryBean and added function to the afterPropertiesSet() method.

Code basically looks like this:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring and Quartz - can't update Triggers in database