异常退出的石英作业的数据持久性?

Data persistence for a quartz job which exits with an exception?

假设我已经安排了一个标有 PersistJobDataAfterExecutionAttribute 的 quartz 作业。这意味着添加到 JobDataMap 的数据将在执行之间保留。我想知道如果作业异常退出,调度程序是否仍会保留作业的 JobDataMap?

如果一个作业用 PersistJobDataAfterExecutionAttribute 注释并且它异常退出,如果 recoveryfail-over 仍然保留它的 JobDataMap 以重新执行它遇到情况。

例如,如果用户捕获到异常并且修改了JobDataMap中的某些内容并重新触发它,如下所示:

JobExecutionException e2 = new JobExecutionException(e);
// fix somekey in JobDataMap
dataMap.Put("sampleKey", "1");

// this job will refire immediately
e2.RefireImmediately = true;

在另一种情况下,如果用户捕获到异常并且对 运行 与此作业关联的所有触发器不感兴趣,则不会保留 JobDataMap。

e2.UnscheduleAllTriggers = true;