Announcement Announcement Module
No announcement yet.
Spring + Quartz: persisted triggers not changing when config is modified Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + Quartz: persisted triggers not changing when config is modified

    Greetings all,

    This may be a simple question, but I haven't been able to find much about it and the behavior confuses me.

    The environment is Quartz 1.5.2/Spring 2.0. I am using persistent cron triggers and I have been trying to change the cron expression and the misfire instruction by changing the properties in the CronTriggerBean.

    I make the changes in the config file, but when I restart the SchedulerFactory for my app the changes are not being reflected in the database for the persisted trigger.

    I'm thinking I must be missing something simple here, but not sure what. Any advice would be greatly appreciated!

  • #2
    When you restart the server, do you get another trigger added to the database instead of it changing the existing one?


    • #3
      Hi, thanks for the reply.

      No, I don't get a new trigger added, it just doesn't change the properties of the existing one.


      • #4
        I'd have a look at the API and see what's on offer. Have you tried this?
        public void setOverwriteExistingJobs(boolean overwriteExistingJobs)

        Set whether any jobs defined on this SchedulerFactoryBean should overwrite existing job definitions. Default is "false", to not overwrite already registered jobs that have been read in from a persistent job store.


        • #5
          Forget that, I'm talking rubbish. You want to change the Trigger details not the Job.


          • #6
            Oh, actually on looking at the source code, it seems the same flag controls both the rescheduling of the Job and the Trigger. That should work after all .


            • #7
              Thanks for the help, I'll give that a try and let you know how it worked out!


              • #8
                Awesome, that worked.



                • #9
                  Great, glad it worked! We both learned something as well .