• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring and Quartz - can't update Triggers in database

 
Aaron Mirsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any takers?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BeForthrightWhenCrossPostingToOtherSites. (Spring Forum)
 
Aaron Mirsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic