i'm using spring batch 2.2.4 with quartz to run some jobs at certain time
the problem is the jobs always run after executing the code at the first time then it runs based on the scheduled time. I want to stop the first run and let it only runs based on the scheduled time.
my cron expression is "0 0 0 * * ?" & I also tried "0 0 0 1/1 * ? *" but it still executes once when the application starts
how can I stop the first execution when the application starts?
this is the job context file:
<batch:job id="exceptionLogJob">
<batch:step id="exceptionLogReadWriteStep">
<batch:tasklet >
<batch:chunk reader="exceptionLogReader" writer="exceptionLogWriter"
commit-interval="1000" />
</batch:tasklet>
</batch:step>
</batch:job>
<!-- ======================================================= -->
<!-- READER -->
<!-- ======================================================= -->
<bean id="exceptionLogReader"
class="org.springframework.batch.item.database.JdbcCursorItemReader">
<property name="dataSource" ref="dataSource" />
<property name="sql" value="SELECT a.*,a.rowid FROM SF_EXCEPTION_LOG a WHERE DATETIME > SYSDATE - 1" />
<property name="rowMapper" ref="ExceptionLogRowMapper" />
</bean>
<!-- ======================================================= -->
<!-- Writer -->
<!-- ======================================================= -->
<bean id="exceptionLogWriter"
class="com.mobily.sf.batchprocessor.exceptionlog.ExceptionLogWriter" />
<bean id="jobDetailExceptionLog" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass"
value="com.sf.batchprocessor.commons.JobLauncherDetails" />
<property name="jobDataAsMap">
<map>
<entry key="jobName" value="exceptionLogJob" />
<entry key="jobLocator" value-ref="jobRegistry" />
<entry key="jobLauncher" value-ref="jobLauncher" />
</map>
</property>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<bean id="cronTrigger"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobDetailExceptionLog" />
<property name="cronExpression" value="0 0 0 1/1 * ? *" />
</bean>
</property>
</bean>
</beans>