【问题标题】:Open new transaction in Spring Batch - @AfterJob event?在 Spring Batch 中打开新事务 - @AfterJob 事件?
【发布时间】:2012-10-10 15:33:17
【问题描述】:

我正在使用 Spring Batch 框架,我想知道是否可以在 @AfterStep@AfterJob 事件中打开新事务?

我看到当我尝试在这些事件中执行 SQL 查询时,当前事务已关闭。

【问题讨论】:

    标签: spring transactions spring-batch


    【解决方案1】:

    您是否尝试使用 @Transactional 注释和 REQUIRES_NEW 来注释您的方法?

    【讨论】:

      猜你喜欢
      • 2012-12-19
      • 1970-01-01
      • 2021-09-25
      • 2014-12-01
      • 2019-10-18
      • 1970-01-01
      • 2021-02-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多