Here you have the result from the BATCH_STEP_EXECUTION table
Code:
ID VERSION STEP_ID JOB_EXECUTION_ID START_TIME END_TIME STATUS COMMIT_COUNT TASK_COUNT TASK_STATISTICS CONTINUABLE EXIT_CODE EXIT_MESSAGE
1 0 1 1 2008-01-25 20:39:00.351 2008-01-25 20:39:30.618 COMPLETED 2 2 #Fri Jan 25 20:39:30 CET 2008
sqlCursorInput.skippedRrecordCount=0
sqlCursorInput.lastProcessedRowNum=1
N COMPLETED (null)
2 0 2 2 2008-01-25 20:40:13.111 2008-01-25 20:40:15.528 COMPLETED 1 1 #Fri Jan 25 20:40:15 CET 2008
sqlCursorInput.skippedRrecordCount=0
sqlCursorInput.lastProcessedRowNum=1
N COMPLETED (null)
3 0 3 3 2008-01-25 20:41:03.45 2008-01-25 20:41:05.516 COMPLETED 1 1 #Fri Jan 25 20:41:05 CET 2008
sqlCursorInput.skippedRrecordCount=0
sqlCursorInput.lastProcessedRowNum=1
N COMPLETED (null)
We want to process the "select * from SUBSCRIPTION_LINES where active = 1 and subscriptionLineId = 3" once every 24 hour, - and do inserts into other tables, - though via jdbc... It doesn't seem to read the table, after having processed the table once.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<description>This file defines the job for the ticker process.</description>
<import resource="classpath:/springAccountBalancerCore-configurer.xml"/>
<import resource="classpath:/springAccountBalancerCore-dao.xml"/>
<import resource="classpath:/springAccountBalancerCore-biz.xml"/>
<bean id="simpleTickerJob" class="org.springframework.batch.core.configuration.JobConfiguration" abstract="true">
<property name="restartable" value="false" />
</bean>
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />
<bean id="tickerJob" parent="simpleTickerJob">
<property name="steps">
<bean id="tickerStep1"
class="org.springframework.batch.execution.step.RepeatOperationsStepConfiguration">
<property name="tasklet">
<bean
class="org.springframework.batch.execution.tasklet.RestartableItemProviderTasklet">
<property name="itemProvider">
<bean class="org.springframework.batch.item.provider.InputSourceItemProvider">
<property name="inputSource" ref="hibernateTickerJobInputSource"/>
</bean>
</property>
<property name="itemProcessor">
<bean class="no.aftenposten.accountbalancer.batch.processor.SubscriptionLineTickerProcessor">
<property name="outputSource" ref="hibernateTickerJobOutputSource"/>
<property name="deliveryCalendarManager" ref="deliveryCalendarManager"/>
<property name="productLineDao" ref="productLineDao"/>
<property name="subscriptionDao" ref="subscriptionDao"/>
<property name="accountingManager" ref="accountingManager" />
</bean>
</property>
</bean>
</property>
<property name="chunkOperations">
<bean class="org.springframework.batch.repeat.support.RepeatTemplate">
<property name="interceptors" ref="hibernateTickerJobOutputSource"/>
<property name="completionPolicy">
<bean
class="org.springframework.batch.repeat.policy.SimpleCompletionPolicy">
<property name="chunkSize" value="1" />
</bean>
</property>
</bean>
</property>
<property name="stepOperations">
<bean class="org.springframework.batch.repeat.support.RepeatTemplate">
<property name="exceptionHandler">
<bean
class="org.springframework.batch.repeat.exception.handler.SimpleLimitExceptionHandler"
p:limit="2" p:useParent="true" p:type="java.lang.Exception" />
</property>
</bean>
</property>
</bean>
</property>
</bean>
<!-- This is a framework class that needs a delegate and also needs to be registered as a RepeatInterceptor in the chunk -->
<bean id="hibernateTickerJobOutputSource"
class="org.springframework.batch.io.support.HibernateAwareItemWriter">
<property name="sessionFactory" ref="sessionFactoryCoreAb" />
<property name="delegate" ref="subscriptionLineTickerJobWriter" />
</bean>
<bean id="subscriptionLineTickerJobWriter"
class="no.aftenposten.accountbalancer.batch.outputsource.AccountingWriter" parent="accountingJdbcDao">
</bean>
<!--class="no.aftenposten.accountbalancer.batch.outputsource.AccountingWriter">-->
<!--<property name="dataSource" ref="oracleDataSource" />-->
<bean id="hibernateTickerJobInputSource" class="org.springframework.batch.io.cursor.JdbcCursorInputSource">
<property name="dataSource" ref="pulsDataSource"/>
<property name="mapper">
<bean class="no.aftenposten.accountbalancer.batch.mapper.SubscriptionLineMapper"/>
</property>
<property name="sql" value="select * from SUBSCRIPTION_LINES where active = 1 and subscriptionLineId = 3"/>
</bean>
</beans>