Reg。作业级别的春季批处理作业的事务支持 [英] Reg. transaction support for a spring batch job at job level
问题描述
让我们假设我需要执行2个步骤的Spring Batch作业。步骤1是从postgres表中读取数据并更新同一表中的值。第2步是从另一个postgres表读取数据并更新此表。在这种情况下,我如何在工作级别上完成事务?
Lets assume that i need to execute a spring batch job with 2 steps.step 1 is to read data from a postgres table and update values in the same table. step 2 is to read data from another postgres table and update this table. How can i achieve transactions at job level for this scenario?
也就是说,如果第二步失败,则应该回退第一步。
That is, if the second step fails, then the first step should be rolled back.
推荐答案
您是否考虑过使用工作级事务性?
Have you considered using job-level transactionality?
< a href = https://stackoverflow.com/questions/12492176/job-level-transactionality-in-spring-batch>春季批处理中的工作级交易性
重要的是要考虑要管理的潜在卷大小,以避免超出限制的提交或回滚。
这篇关于Reg。作业级别的春季批处理作业的事务支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!