| Author |
Rescheduling jobs in Quartz with JobStoreTX
|
Andre Fonseca
Greenhorn
Joined: Jan 08, 2010
Posts: 5
|
|
Hi all,
I am running Quartz in weblogic and I have setup it with JobStoreTX.
I am also using org.quartz.ee.servlet.QuartzInitializerListener to start Quartz jobs in a webapp in weblogic.
When I start the app the first time everything occurs fine and quartz populate the tables in DB.
But when I start the app again I receive the message
This is because I need to reschedule the jobs right?
The Quartz API is enought to control the rescheduling of should I control that by myself using for example a flag or a status in the database?
I was wondering if the code below is enought
But I still got the same exception.
I am using Quartz 1.7.3
Any idea would be very appreciated.
Tks
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
Hi Andre and welcome to Javaranch!
It looks like the rescheduling is effectively storing the same trigger each time (which is therefore treated as a duplicate), is there some way you can uniquely create each trigger (or delete the old trigger before inserting the new one).
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
Andre Fonseca
Greenhorn
Joined: Jan 08, 2010
Posts: 5
|
|
Martijn Verburg wrote:Hi Andre and welcome to Javaranch!
It looks like the rescheduling is effectively storing the same trigger each time (which is therefore treated as a duplicate), is there some way you can uniquely create each trigger (or delete the old trigger before inserting the new one).
Hi Martijn,
Thanks for your reply!
My doubt is conceptual I think.
My scenario is: I need to run Quartz in a webapp in cluster using JobStoreTX.
Could I use the same trigger to reschedule the jobs when necessary or not?
Looking in the Quartz API I have found
Date rescheduleJob( String triggerName,
String groupName,
Trigger newTrigger)
throws SchedulerException
Remove (delete) the Trigger with the given name, and store the new given one - which must be associated with the same job (the new trigger must have the job name & group specified) - however, the new trigger need not have the same name as the old trigger.
I am trying to use that method without sucess..
Tks
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
|
That seems to be the right method to use yes, have you entered into DEBUG mode and traced the call down?
|
 |
 |
|
|
subject: Rescheduling jobs in Quartz with JobStoreTX
|
|
|