스프링 배치를 사용하여 배치를 개발 중입니다. 두 단계가 있는데, step1은 table1을 업데이트하고 다른 step2는 table2를 업데이트했습니다.스프링 배치의 트랜잭션 관리
두 번째 step2가 실패하면 모든 치료가 취소됩니다 (롤백). 어떻게해야합니까 ??
<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>
감사 :
나는 아래의 샘플 XML 설정을 가지고!
보기. 이것은 아이디어를 줄 수 있습니다. http://stackoverflow.com/questions/14369876/spring-batch-and-x-and-local-transactions –