[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Trigger is being deleted after last execute.  XML
Forum Index -> Quartz
Author Message
Sprycjan

neo

Joined: 11/11/2010 14:23:38
Messages: 4
Offline

I have a Job with a Trigger wich will be executed only once at a specific time and it will not be reexecuted any more. The Job is stored in a Database.
F.e. Cron trigger with expression "0 31 13 15 * ? 2010". It will be executed only once.

I noticed that after it executes, it is deleted from the database.

Is there a way to prevent such behaviour?

I just need to keep history of triggered events.
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Offline


Make your jobs 'durable' (set the property to true on the JobDetail) and they'll linger after the triggers are gone.

If you need more than that, you'll have to implement a TriggerListener (or JobListener) to record whatever historical info you want. See the "logging listeners" that ship with Quartz for examples...
Sprycjan

neo

Joined: 11/11/2010 14:23:38
Messages: 4
Offline

Thanks for the reply.
Your solution works but for job details. Even if job details are durable, triggers for these jobs are still deleted.

How to make triggers durable?
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Offline


Can't. Triggers are deleted when completed to avoid massive build-up in the database (many users have tens-of-thousands of triggers in relatively short periods of time).

You'll have to implement a TriggerListener to record them.
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team