-
Jul 30th, 2009, 10:04 AM
#1
why Some record are missing when I am restarting a Job ?
I am reading a file and writing record of that file into another file.
I have configure job for restart.
I have set commit interval to 200.
when a job fail say it is fail after 3000 record .but when I restart job
it start reading from 3001 record but it start writing record from 2801
so previous record from 2801 to 3000 are missing in resulting file ?
BATCH STEP EXECUTION Contex value is like this
{"map":{"entry":[{"string":"FlatFileItemWriter.written","long":3000},{"string":"FlatFileItemWriter.current.count","lo ng":353299},{"string":"MultiResourceItemReader.ite mIndex","int":1000},{"string":"MultiResourceItemRe ader.resourceIndex","int":1}]}}
{"map":{"entry":[{"string":"FlatFileItemWriter.written","long":1309 },{"string":"FlatFileItemWriter.current.count","lo ng":504927},{"string":"MultiResourceItemReader.ite mIndex","int":1},{"string":"MultiResourceItemReade r.resourceIndex","int":2}]}}
I have configure job as follows
<beans:bean id="itemWriter"
class="org.springframework.batch.item.file.FlatFil eItemWriter">
<beans
roperty name="resource"
value="file:c://abc1.txt" />
<beans
roperty name="lineAggregator">
<beans:bean class="org.fss.validator.example.LineAggregatorFor Writer" />
</beans
roperty>
</beans:bean>
<job id="batchJob" restartable="true">
<step id="playerload">
<tasklet>
<chunk reader="multiResourceReader"
writer="itemWriter" commit-interval="200">
<streams>
<stream ref="multiResourceReader" />
<stream ref="itemWriter"/>
</streams>
</chunk>
</tasklet>
</step>
</job>
please tell me am I configure some thing wrong ?
and I want name of file to be generated dynamically at run time How I can archive that ?
Thanks ..
-
Jul 30th, 2009, 10:25 AM
#2
This bug was fixed for Spring Batch 2.0.1 (http://jira.springframework.org/browse/BATCH-1225). Which version are you using? 2.0.2 is current and contains many bug fixes, so you should upgrade if at all possible.
See this post for the dynamic filename generation: http://forum.springsource.org/showthread.php?t=75426
-
Jul 31st, 2009, 05:57 AM
#3
2.0.2 is official Release ? can we use it in production ?
Thanks I was using 2.0.0
2.0.2 is official Release ? can we use it in production ?
-
Jul 31st, 2009, 09:06 AM
#4
Yes, 2.0.2 is the release you should you because it fixes bugs that exist in 2.0.0.
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