Change jobdatamap after job is scheduled

1,597 views
Skip to first unread message

mmoore99

unread,
Aug 18, 2008, 12:51:38 AM8/18/08
to Quartz.NET
Is it possible to change values in the jobdatamap for a job that has
already been scheduled?

Marko Lahma

unread,
Aug 18, 2008, 4:53:59 AM8/18/08
to quar...@googlegroups.com
Hi,

It should be if you change your job to be IStatefulJob, please see
http://quartznet.sourceforge.net/tutorial/lesson_3.html and especially
the part about stateful jobs.

Hope this helps,

-Marko

FrankD

unread,
Sep 30, 2008, 5:43:14 AM9/30/08
to Quartz.NET
Hi,

I'm trying to figure out how to change the jobDataMap on a scheduled
IStatefulJob, but seems to be missing out something. If I go like
this:

....
JobDetail jobDetail = Scheduler.GetJobDetail("XXXX");
jobDetail.JobDataMap = newJobDataMap;

Then what? I can't figure out how to post the new jobDataMap back to
the scheduler. Should I re-schedule the job or?

Thanks

/Frank

On 18 Aug., 10:53, "Marko Lahma" <marko.la...@gmail.com> wrote:
> Hi,
>
> It should be if youchangeyour job to be IStatefulJob, please seehttp://quartznet.sourceforge.net/tutorial/lesson_3.htmland especially
> the part about stateful jobs.
>
> Hope this helps,
>
> -Marko
>
>
>
> On Mon, Aug 18, 2008 at 7:51 AM, mmoore99 <mmo...@usa.net> wrote:
>
> > Is it possible tochangevalues in thejobdatamapfor a job that has
> > already been scheduled?- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

Marko Lahma

unread,
Nov 5, 2008, 5:21:52 PM11/5/08
to quar...@googlegroups.com
Hi,

JobDetails are cloned from retrieved from RAMJobStore or AdoJobStore.
This is done even in RAMJobStore to maintain the same semantics as in
database-backed store. When you retrieve something and change it, it
won't be persisted before you explicitly save it. This means that you
need to save your JobDetail back to your back-end store using
IScheduler.AddJob(JobDetail jobDetail, bool replace), with replace =
true.

Hope this helps,

-Marko
Reply all
Reply to author
Forward
0 new messages