Java – Quartz doesn’t remove deleted job from the scheduling

javajobsquartz-scheduler

I'm developing scheduled services.

The application is developed using JDK 1.6, Spring Framework 2.5.6 and Quartz 1.8.4 to schedule jobs.

I've two clustered servers with WebLogic Server 10.3.5.

The behavior that I noticed is that if a job is removed (or renamed) from the application, Quartz keeps trying to launch the old job (which seems to be registered in the database that Quartz uses to synchronize its instances).

Can someone explain the reason for this behavior?

My need is that when I delete a job in the application and I restart WebLogic instances, Quartz does not attempt to boot the old job.

Thanks in advance

Best Answer

You need to remove the job explicitly from the quartz scheduler, have you done that? for example if you have this scedhuler

private org.quartz.Scheduler myScheduler = null;

you need to invoke:

myScheduler.deleteJob(...

when the job is removed or renamed.

If you do, maybe you're passing incorrect key?

Alternatively, when you build the quartz job, you can use: jobBuilder.storeDurably(false) This will cause your quartz job to be deleted automatically when there are no longer active trigger associated to it.

Related Topic