Job level Transactionality in Spring Batch

前端 未结 1 1077
抹茶落季
抹茶落季 2020-12-19 12:34

I know right now there is no such thing as inter-step transactionality in Spring-Batch. I\'m developing a complex batch job, with many steps performing several actions in da

1条回答
  •  鱼传尺愫
    2020-12-19 13:24

    Finally I have found a way to do this. As said in the last edition you must invoke the job from a transactional method:

    @Transactional(propagation=Propagation.REQUIRED)

    It's important set the propagation level to required in this level. And set the job level propagation to "mandatory", achieving with this the job and steps add their transactions to the current one. Nevertheless, as Michael Lange wrote, it's important to consider the potential volume size you are managing, in order to avoid out-of-the-limit commits or rollbacks.

    0 讨论(0)
提交回复
热议问题