【发布时间】:2013-09-26 14:35:51
【问题描述】:
我正在使用 spring batch 开发一个批处理,我有两个步骤,一个更新 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>
谢谢!
【问题讨论】:
-
看这个。这可能会给出一个想法。 stackoverflow.com/questions/14369876/…
标签: java spring spring-batch