Forums Register Login

Rescheduling jobs in Quartz with JobStoreTX

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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).
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
That seems to be the right method to use yes, have you entered into DEBUG mode and traced the call down?
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4075 times.
Similar Threads
Get the correct time from Date object
quartz Fired_triggers table always growing
cron vs Quartz
Issue in Quartz rescheduling
How to get a quartz job to use a hibernate transaction session
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:25:42.