Results 1 to 5 of 5

Thread: Infinite loop with IbatisPagingItemReader

  1. #1
    Join Date
    Feb 2009
    Location
    Paris
    Posts
    30

    Default 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. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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.

  3. #3
    Join Date
    Mar 2009
    Posts
    8

    Default

    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

  4. #4
    Join Date
    Jun 2005
    Posts
    4,230

    Default

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

  5. #5
    Join Date
    Mar 2009
    Posts
    8

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •