我正在使用spring批处理开发一个批处理,我有两个步骤,一个step1更新table1,另一个step2更新table2。Spring批处理事务管理
我想如果第二步2失败,那么所有的治疗被取消(回滚)。我该怎么办??
我有下面的示例XML配置:
<b:step id="Step1" parent="Tache">
<b:tasklet>
<b:chunk reader="baseReader" processor="baseProcessor"
chunk-completion-policy="completionPolicy" />
</b:tasklet>
</b:step>
<b:step id="Step2" parent="Tache">
<b:tasklet>
<b:chunk reader="baseReaderEcriture"
writer="ecritureWriter" chunk-completion-policy="completionPolicy" />
</b:tasklet>
</b:step>
<b:job id="batch" parent="Batch">
<b:step id="step1" parent="Step1" next="step2"/>
<b:step id="step2" parent="Step2" />
</b:job>
谢谢!
看到这个。这可能会产生一个想法。 http://stackoverflow.com/questions/14369876/spring-batch-and-xa-and-local-transactions –