badgerduke (12) [Avatar] Offline
#1
Hello:

I am wondering if there are any problems with IbatisPagingItemReader. When I have a page size of 25, items 21 through 25 get repeated in the flat file (written with FlatFileItemWriter) before the next page gets processed. The query used to generate the data works fine.


<bean id="reportReader" class="xxx.yyy.ReportPagingReader" lazy-init="true">
<property name="sqlMapClient" ref="sqlMap"/>
<property name="queryId" value="iBATISMap.reviewReportPaginated"/>
<property name="pageSize" value="#{systemProperties['student.review.page.size']}"/>
<property name="parameterValues">
<map>
<entry key="year" value="#{T(xxx.yyy.CalendarUtil).CURRENT_YEAR()}"/>
</map>
</property>
</bean>

<bean id="reportWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step">
<property name="resource" value="#{jobParameters['reviewOutputFile']}"/>
<property name="headerCallback" ref="reportHeaderCallback"/>
<property name="footerCallback" ref="reportFooterCallback"/>
<property name="lineAggregator" ref="reportTranslator"/>
<property name="shouldDeleteIfEmpty" value="true"/>
</bean>


<batch:step id="readWriteReport">
<batch:tasklet>
<batch:chunk reader="reportReader" writer="reportWriter" commit-interval="10000"/>
<batch:listeners>
<batch:listener ref="reportStepListener"/>
<batch:listener ref="reportHeaderCallback"/>
<batch:listener ref="reportFooterCallback"/>
</batch:listeners>
</batch:tasklet>
</batch:step>


Thanks
Eric
badgerduke (12) [Avatar] Offline
#2
Re: Duplicate lines being printed in flat file
Never mind . . . a typo!