| Author |
Spring/quartz/ reading excluded holidays from DB(dynamically)
|
Santosh Ramachandrula
Ranch Hand
Joined: Apr 04, 2004
Posts: 252
|
|
Hi, I have a scenario where
1. I want to trigger a job on all weekdays, not on Saturday/Sunday/Public Holiday like (Memorial Day, Thanks giving Wknd, July 4'th, Jan 1'st etc).
2. I will be saving the holidays(Memorial Day, Thanks giving Wknd etc.) in a DB table that will have holidays for the next 3 years.
3. If the information in DB does not change it is straightforward, if it changes then I will have to restart my App server.
4. With the DB holiday list changing on fly, can I accomplish scheduling the jobs without restarting the app server (clustered environment)?
Please let me know if you need more information
|
Thanks,
Santosh
|
 |
Duc Vo
Ranch Hand
Joined: Nov 20, 2008
Posts: 254
|
|
|
What about another job to reload the settings from DB running says everyday?
|
“Everything should be as simple as it is, but not simpler.” Albert Einstein
|
 |
Santosh Ramachandrula
Ranch Hand
Joined: Apr 04, 2004
Posts: 252
|
|
|
Good idea and thank you. Let me work on my test case and see if I can accomplish this.
|
 |
Nathan Pruett
Bartender
Joined: Oct 18, 2000
Posts: 4121
|
|
|
How about just running the job every weekday (since this is an easy schedule to set up in quartz), and having the first step of the job be to check against the database whether it should run the rest of the job or not?
|
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
|
 |
Santosh Ramachandrula
Ranch Hand
Joined: Apr 04, 2004
Posts: 252
|
|
|
Nathan, You are right and it is one of the solutions that we have. I am researching if I can run the jobs only on non-holidays as I mentioned above with holiday(s) list in DB without having to do manual/code check in the scheduled job.
|
 |
 |
|
|
subject: Spring/quartz/ reading excluded holidays from DB(dynamically)
|
|
|