views:

391

answers:

1

Simple question, I think.

I have org.springframework.scheduling.quartz.CronTriggerBean triggering one job once a day. Because this method can last a long time (over 24 hours), will the next day at the same time a new job be executed if the last one is not ended yet?

If yes - is it possible to turn off executing new jobs until the last one is finished?

My method is trans-coding videos and some days there a lot of videos and could last long.

A: 

Make the Job stateful, So it will prevent the new instance before the previous instance of the job ended.

You 'mark' a Job as stateful by having it implement the StatefulJob interface. You will get more about stateful job here

Bipul