Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Rescheduling jobs in Quartz with JobStoreTX

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
I am going to test your electrical conductivity with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic