我正在使用spring批处理开发一个批处理,我有两个步骤,一个更新table1的step1和另一个更新table2的step2。
我想如果第二步失败,那么所有的处理都被取消(回滚)。我应该怎么办??
我有下面的示例 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>
谢谢!