Announcement Announcement Module
Collapse
No announcement yet.
Infinite loop with IbatisPagingItemReader Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Infinite loop with IbatisPagingItemReader

    Hello,

    I'm trying to implement a step which reads data from a table using the ibatis itemReader provided by the framework.
    This almost works by I've the problem that the reader seems to loop, infinitly, doing request again and again.
    I'm a beginner in String Batch so, a little help would be welcome

    Here is the code of my step
    Code:
    <step id="stepTwo">
    <tasklet 
        reader="dbDataFromFlatFileReader" 
        writer="itemWriter" 
        processor="pojoToPojoProcessor" 
        commit-interval="1" />
    </step>
    The itemWriter is just a basic Writer which log the data on the console, indicating the data are well send by the reader. And the pojoToPojoProcessor is just making a mapping from an object to another

    Here is the code of my Reader
    Code:
    <beans:bean id="dbDataReader" 
        class="org.springframework.batch.item.database.IbatisPagingItemReader">
        <beans:property name="sqlMapClient" 
            ref="sqlMapClient"/>
        <beans:property name="queryId" 
            value="dffSelect"/>
    </beans:bean>
    and finally, here is the code of my request
    Code:
    <select id="dffSelect" resultMap="abatorgenerated_DataFromFlatFileResult">
        select 
            DFF_COL_1,
            DFF_COL_2,
            DFF_COL_3
        from 
            DATA_FROM_FLATFILE
    </select>
    Any idea why it is looping ? I guess it is because the read() method of the itemReader never sends back "null". But why ? Did I forget to do something ?

  • #2
    Can't see anything wrong; maybe a bug. Can you look at the log output from Ibatis and see the queries being executed? Maybe a clue there.

    Comment


    • #3
      Hello,

      I have the same problem.
      It loops on the results of the first page.

      I noticed that when I change the page size so that it is greater than the results number that works fine.

      Is it a bug ?

      Please need some help

      Comment


      • #4
        Any logs? (Please use [code][/code] tags to post code and stack traces.)

        Comment


        • #5
          Sorry I thought I had nothing to do with the SQL request but no.
          So it is well described in the reference documentation and it works fine.

          Zico, you have to modify your select to manage pagination and it depends on your database.

          See http://static.springsource.org/sprin...x.html#d0e5520

          Comment

          Working...
          X