Hello All,
I'm using RC2 and seem to have problems with processing exceptions during db insert.
I have 5 files with one record in each, they are retrieved and passed to JdbcBatchItemWriter. The exception, configured as skippable is thrown during the db commit (one file contains error). I would expect that transaction will be rolled back and there will be no new records in db. Instead in the listener @AfterWrite I see that all items are processed again one by one, and 4 out of 5 records end up in the database. Now, in RC1 @AfterWrite was called as well, but no records where actually added to DB. Is it new functionality or bug in RC2?
HTML Code:<job id="SpringBoard_AR_DD_Job"> <step id="load"> <tasklet reader="SpringBoard_AR_DDItemReader" writer="SpringBoard_AR_DDItemWriter" commit-interval="${job.commit.interval}" skip-limit="10"> <skippable-exception-classes> org.springframework.dao.DataIntegrityViolationException </skippable-exception-classes> </tasklet> <listeners> <listener ref="SpringBoard_AR_DDstepListener"/> </listeners> <fail on="FAILED" exit-code="EARLY TERMINATION"/> <next on="COMPLETED WITH SKIPS" to="moveForRetry" /> <next on="*" to="moveToComplete" /> </step> <step id="moveForRetry" tasklet="SpringBoard_AR_DDretryMovingTasklet" next="moveToComplete"/> <step id="moveToComplete" tasklet="SpringBoard_AR_DDcompMovingTasklet"/> </job> <beans:bean id="SpringBoard_AR_DDItemWriter" class="org.springframework.batch.item.database.JdbcBatchItemWriter"> <beans:property name="dataSource" ref="dataSource" /> <beans:property name="itemPreparedStatementSetter"> <beans:bean class="com.cce.filenet.reports.dao.SpringBoard_AR_DDPreparedItemSetter" /> </beans:property> <beans:property name="sql" value="INSERT INTO SpringBoard_AR_Driver_Docs (DriverCode, DivisionNum, SalesBranch, DateSettled, ArchiveDate, UpdateStatus) VALUES (?,?,?,?,?,?)" /> </beans:bean>


Reply With Quote