Announcement Announcement Module
Collapse
No announcement yet.
why Some record are missing when I am restarting a Job ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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">
    <beansroperty name="resource"
    value="file:c://abc1.txt" />
    <beansroperty name="lineAggregator">
    <beans:bean class="org.fss.validator.example.LineAggregatorFor Writer" />
    </beansroperty>
    </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 ..

  • #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

    Comment


    • #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 ?

      Comment


      • #4
        Yes, 2.0.2 is the release you should you because it fixes bugs that exist in 2.0.0.

        Comment

        Working...
        X