Update an existing JobDataMap

Paul Tomblin picture Paul Tomblin · May 13, 2010 · Viewed 18.5k times · Source

I have a Quartz job that has already been scheduled. I want to update the JobDataMap associated with it. If I get a JobDataMap with JobDataMap jobDataMap = scheduler.getJobDetail(....).getJobDataMap(), is that map "live"? ie. if I change it, will it be persisted in the scheduler? If not, how do I persist it?

Answer

Bozho picture Bozho · Aug 25, 2011

In quartz 2.0. StatefulJob is deprecated. In order to persist the job data map, use @PersistJobDataAfterExecution on the job class. It usually goes with @DisallowConcurrentExecution.