[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Supress Firing of Triggers  XML
Forum Index -> Quartz
Author Message
sumeetc

journeyman

Joined: 03/08/2012 04:07:21
Messages: 10
Offline

Hello Techies,

I have one query regarding the scheduling mechanism of quartz. The requirement for my application demands that if for some reason the server goes down and once when it is online, I have to read all the job names and the details of schedules from the database and have to trigger those jobs. Consider the following example.

1) I schedule a job to start on 10 of January 2012 and will end on say 20th August 2012 and the job is scheduled to run every Monday, Wednesday and Thursday at 11 AM

2) The application runs fine and the triggers are getting executed appropriately until one fine day say on 10th of April 2012, the server goes down for maintenance purpose and comes back in an hour's time.

3) As per the requirement, the system on start up reads all the data from the database and schedules them again, here where the problem actually starts. When I provide the start date as 10th of January 2012 and end date as 20th August 2012, the trigger starts getting fired till 10th of April 2012 assuming that it has not executed till date.

Can we somehow suppress those triggers getting fired from 10th of January 2012 to till date? Is there any kind of boolean flag that I can set to tell quartz to not to execute those triggers. Any help is highly appreciated.

Regards,
Sumeet C
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online


You should be able to choose a misfire policy for the triggers that give you the desired behavior.

Not sure why you're rescheduling everything after restart though - are you using RAMJobStore ?
sumeetc

journeyman

Joined: 03/08/2012 04:07:21
Messages: 10
Offline

Hello,

Yes, I am using the RAMJobStore. What will be the best approach that I should adhere to under these scenarios? I want to schedule the jobs again when the scheduler comes up. One way could be to assign the startDate field to current date. Would really appreciate if you could come up with a suitable approach.

Regards,
Sumeet C
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online

Setting the start time to the current time is the easiest/best/most fool-proof solution.
sumeetc

journeyman

Joined: 03/08/2012 04:07:21
Messages: 10
Offline

Hello,

Thanks a lot for posting the reply. I will go ahead with the approach of setting the startTime to current time.

Regards,
Sumeet C
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team