[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
How to stop a Job?  XML
Forum Index -> Quartz
Author Message
Balrog78

neo

Joined: 01/29/2012 12:29:49
Messages: 2
Offline

I usually got to the _TRIGGERS table and change the

TRIGGER_STATE=COMPLETED!!

But this is temporary. On restarting the quartz service, the scheduler changes the above state back to WAITING and continues the job.

I'm looking for a non-JMX way to permanently disable a job are runtime. Can anyone help?
Bermudo

neo

Joined: 03/05/2010 22:34:35
Messages: 7
Location: Modena, Italy; Berlin, Germany; Madrid, Spain
Offline

No matter what you are trying to accomplish, you should NEVER access the Quartz database tables directly. They are managed by the scheduler.

I assume that you want to delete a job, not stop (interrupt) it.

If you want to delete a trigger, you retrieve the scheduler instance and call unscheduleJob( <TriggerKey> ), where TriggerKey contains the names of the trigger and trigger group.

You can also call deleteJob( <JobKey> ) but this will delete ALL triggers, not just one.
Balrog78

neo

Joined: 01/29/2012 12:29:49
Messages: 2
Offline

Bermudo,

I understand we should not access the Quartz tables - unfortunately, asI indicated, we don't have JMX support for the quartz (some internal protocols prevent this) - what would need to be done to permanetly pause the job until we take a call to unpause it?

Like I said, updating the _TRIGGERS to a status other than WAITING doesn't help as it gets reset when the quartz server comes back up.
Bermudo

neo

Joined: 03/05/2010 22:34:35
Messages: 7
Location: Modena, Italy; Berlin, Germany; Madrid, Spain
Offline

I guess I was three steps ahead of you. I have used Quartz both in web applications as well as simple socket servers to control the scheduler without JMX. But that takes a little programming.

If you want to add and delete jobs and triggers without interacting programmatically with the scheduler, you can do it by using XML job configuration with the XMLSchedulingDataProcessorPlugin.

Since Quartz version 2, the configuration schema contains elements--'preprocessing-commands' and 'preprocessing-instructions'--that let you control how jobs and triggers are loaded when the configuration file is (re-)loaded. (See, for example, 'preprocessing-commands' child elements 'delete-job', 'delete-job,-in-group', 'delete-trigger', 'delete-triggers-in-group'.)

The documentation is bit sparse, but once you have the plugin configured and working, it is not difficult to figure out the right XML configuration.
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1491
Offline

issue seems to be resolved , closing the topic.

Rakesh Joshi
Senior Consultant
Terracotta.
gyan10

ophanim

Joined: 06/28/2011 23:15:25
Messages: 701
Offline

I think issue is resolved.I want to suggest you that quarzt documentaion is very good place to get such details.Please read on its website.

Cheers!!!

Gyan Awasthi
Terracotta -A Software AG company
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team