• 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
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Quartz Triggers re-firing before the last Job has completed execution...

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've configured a Quartz scheduler using Spring ContextLoaderListener. Everything is working fine, but I'm having a problem with Trigger "overlap".

When Trigger X fires, it kicks off Job X. IF Trigger X fires again, before Job X is complete, Job X will launch again, creating all sorts of race conditions, concurrency issues, Hibernate Sessions closing, dogs and cats living together in sin, etc.

How can I tell Trigger X to not launch the job, if the Job is already running?

I thought this was related to Trigger misfires, but apparantly that's something else entirely unrelated...

Help!
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that you want to implement a TriggerListener, and provide an appropriate vetoJobExecution method to enforce the behaviour you want. See:

Quartz Tutorial Lesson 7

Guy
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is pretty much exactly what I was looking for. Just thought the functionality might be built-in...

Thanks Guy!
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a 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