I'm running into an interesting issue trying to use a JdbcCursorItemReader against an Oracle database. When the commit-interval is reached and the first chunk commits, I get a "Caused by: java.sql.SQLException: ORA-01002: fetch out of sequence" from the ItemReader.
It almost looks like the cursor was opened FOR UPDATE. This is in a XA transaction in JBoss 5.1.0. Has anyone run into this issue before? Any configuration I could be missing ?
Would really appreciate any help ...
Code:<bean id="customer.addressLineUpdateReader" class="org.springframework.batch.item.database.JdbcCursorItemReader" p:dataSource-ref="springbatch.repositoryDataSource"> <property name="rowMapper"> <bean class="org.springframework.jdbc.core.BeanPropertyRowMapper"> <property name="mappedClass" value="com.company.CustomerAddressDTO"/> </bean> </property> <property name="sql" value=" select cust_addr_id recordId, cust_id customerId from customer_address where void_ind = 'n' and cust_addr_typ_cd = 'abc'" /> </bean> <bean id="customer.addressLineUpdateWriter" scope="step" class="com.company.PerformanceAddressLineUpdateWriter"/> <batch:job id="customer.job.addressLineUpdateJob" job-repository="springbatch.jobRepository" parent="springbatch.job.baseJob"> <batch:step id="partitionStep" parent="springbatch.step.baseStep"> <batch:tasklet transaction-manager="xaTransactionManager"> <batch:chunk commit-interval="5" reader="customer.addressLineUpdateReader" writer="customer.addressLineUpdateWriter"/> </batch:tasklet> </batch:step> </batch:job>


Reply With Quote