Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rescheduling jobs in Quartz with JobStoreTX

 
Andre Fonseca
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Andre Fonseca
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That seems to be the right method to use yes, have you entered into DEBUG mode and traced the call down?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic