Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Spring and Quartz - can't update Triggers in database

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any takers?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BeForthrightWhenCrossPostingToOtherSites. (Spring Forum)
 
Aaron Mirsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
reply
    Bookmark Topic Watch Topic
  • New Topic