All, I am experiencing a transaction roll back issue using Spring Batch CompositeItemWriter. The version of Spring batch is 2.2.7.
My configuration is identical to a post here : https://stackoverflow.com/questions/32432519/compositeitemwriter-doesnt-roll-back-in-spring-batch
<bean id="compositeItemWriter" class="org.springframework.batch.item.support.CompositeItemWriter">
<property name="delegates">
<list>
<ref bean="firstItemWriter"/>
<ref bean="secondItemWriter"/>
<ref bean="thirdItemWriter"/>
</list>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${batch.jdbc.driver}" />
<property name="url" value="${batch.jdbc.url}" />
<property name="username" value="${batch.jdbc.user}" />
<property name="password" value="${batch.jdbc.password}" />
</bean>
When there's an exception thrown at thirdItemWriter, data wrote to database by previous writers are not rolling back.
Not sure what I am missing, but my understanding is the composite item writers share the same transaction, all data should be rolled back in the event of exception.
Any suggestion is appreciated