Job level Transactionality in Spring Batch

泄露秘密 提交于 2019-12-01 09:06:38

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!