-
Feb 27th, 2013, 06:22 AM
#1
Spring Batch triggers the job out of scheduling time
Hi,
I have spring batch job (which processes the file) that is scheduled to run at 6,7 and 8 AM everyday. Sometimes the job that starts at 6 AM may not complete by 7 AM. In this case, the logic aborts the job starts at 7 AM. But as soon the first job (started at 6 AM) completes, spring batch is triggering another process which is not scheduled.
For example, Job-A starts at 6 AM. Job-B starts at 7 AM.
At 7 AM, Job-A still running, So Job-B starts and aborts.
At 7:15 AM, Job-A completes, immediately another job gets triggered.
Ideally speaking this should not happen. This is causing unnecessary issue.
Can you anyone help me on this?
The following is the spring configuration:
<bean id="myJob" class="com.test.MyTestJob"/>
<bean id="myJobDetail" class="org.springframework.scheduling.quartz.Metho dInvokingJobDetailFactoryBean">
<property name="targetObject" ref="myJob" />
<property name="targetMethod" value="run" />
<property name="concurrent" value="false" />
</bean>
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronT riggerBean">
<property name="jobDetail" ref="myJobDetail" />
<property name="cronExpression" value="0 0 6-8 * * ?" />
</bean>
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules