Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

windows - Quartz.NET: Need CronTrigger on an iStatefulJob instance to *delay instead of skip* if running job while schedule matures -


greetings, friendly neighborhood quartz.net n00b back!

i have windows service running istatefuljob instances on quartz.net crontrigger based schedule scheme... cron string used schedule job: "0 0/1 * * * ? *"

everything works great. however, if have job set run, say, @ x:00 mark of every minute, , job happens run more minute, notice subsequent job runs after job finished executing, rather waiting until next scheduled run, "queuing" instead of merely skipping job till it's next scheduled run.

i put in trigger crontrigger misfireinstruction of donothing, exact same thing happens when job overruns next scheduled execution schedule.

how istatefuljob instance merely skip scheduled execution trigger if running, rather have delay until first execution completes?

i explicitly set trigger.misfireinstruction = misfireinstruction.crontrigger.donothing;

...but instead of "doing nothing", job scheduled run every minute takes 90 seconds complete, experience following execution log:

  • job runs @ 9:00:00am, finishes @ 9:01:30am <- job runs 1:30
  • job runs @ 9:01:30am, finishes @ 9:03:00am <- subsequent job should have run @ 9:01:00
  • job runs @ 9:04:00am, finishes @ 9:05:30am <- shouldn't 1 have run @ 9:03:00?
  • job runs @ 9:05:30am, finishes @ 9:07:00am <- subsequent job should have run @ 9:05:00
  • job runs @ 9:08:00am, finishes @ 9:09:30am <- shouldn't have run @ 9:07:00?

... seems runs correctly first time, on minute... delays 30 seconds 90 second job execution time expires, , then, instead of waiting till next full minute, executes @ 30 second mark... doubly odd, finishes second job on minute mark, waits till next minute mark execute instead of running back-2-back...

pretty seems works correctly every other run, when not running on :30 marks...

what's best way job not delay/queue, skip until idle , next schedule matures?

edit: tried going ijobs instead of istatefuljobs using same donothing trigger misfire instruction, job executes every minute despite prior execution being still active. can't seem skip scheduled run if running either ijob or istatefuljob...

edit#2: think triggers never misfiring, why donothing misfire instruction useless... given that's case, guess need mechanism detect if job instance of schedule running ensure job skips next execution until following scheduled time rather delaying until first instance completion...

edit3: tried adding element istatefuljob jobdatamap called "isrunning"... set true when execute sequence starts, , return false after job completion. before executing, checks element, apparently persisted between jobs, , prematurely quits execution (logging "job skipped!") if detects true... unfortunately doesn't work, obvious reasons: if jobs running following bulleted schedule above, job never simultaneously running along itself, delaying run till job ends, check useless. according documentation, returning ijob istatefuljob not here jobdatamap persisted between jobs in stateful job type...

i still haven't solved how skip scheduled job instead of delaying till it's current iteration completes... if has ideas, you're lifesaver! :)

it should caused misfirethreshold of ramjobstore (http://quartznet.sourceforge.net/apidoc/topic2722.html).

the time span trigger must have missed next-fire-time, in order considered "misfired" , have misfire instruction applied.

it 60 seconds default. job isn't considered "misfired" until late more misfiredthreshold value.

to resolve problem decrease threshold (below code sets 1 ms):

...    properties["quartz.jobstore.misfirethreshold"] = "1"; ... schedulerfactory = new stdschedulerfactory(properties); 

it should resolve issue.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -