【问题标题】:JTA transaction already rolled back (probably due to a timeout)JTA 事务已经回滚(可能是由于超时)
【发布时间】:2017-06-19 08:05:27
【问题描述】:

当我以调试模式启动服务器并调试我的代码时,就会出现此错误。如果我跳过断点意味着它将起作用。我该怎么办?

org.springframework.transaction.UnexpectedRollbackException: JTA transaction already rolled back (probably due to a timeout)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1021)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:504)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)

【问题讨论】:

    标签: spring jta


    【解决方案1】:

    它的正常行为,如果事务方法超时(任意,5 秒)并且您调试该上下文超过 5 秒,事务应该超时并出现异常。

    您可以尝试临时(出于调试目的)排除添加@EnableTransactionManagement的配置

    刚刚尝试在我的spring boot应用中排除,调试效果很好

    @SpringBootApplication(exclude = DataSourceTransactionManagerAutoConfiguration.class) 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-02
      • 1970-01-01
      • 2016-12-27
      • 2012-04-13
      • 2013-01-19
      • 1970-01-01
      • 2013-06-21
      相关资源
      最近更新 更多