交易超时后,错误的atomikos状态正在中止

时间:2018-11-07 13:14:12

标签: spring atomikos

我正在测试atomikos如何解决事务中的超时。我在从db无限读取中有30秒超时。 30秒钟后,我遇到了这个异常:

14:08:40.329 [Atomikos:4] WARN  c.a.icatch.imp.ActiveStateHandler - Transaction rob-app-b1c7b95a3b0efb82dfb516b04620a213154159609015500001 has timed out - rolling back...

2018-11-07 14:08:40.354 [pool-3-thread-1] WARN  c.a.jdbc.JdbcConnectionProxyHelper - Error enlisting in transaction - connection might be broken? Please check the logs for more information...
java.lang.IllegalStateException: wrong state: ABORTING
    at com.atomikos.icatch.imp.CoordinatorImp.registerSynchronization(CoordinatorImp.java:420)
    at com.atomikos.icatch.imp.TransactionStateHandler.registerSynchronization(TransactionStateHandler.java:129)
    at com.atomikos.icatch.imp.CompositeTransactionImp.registerSynchronization(CompositeTransactionImp.java:177)
    at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:211)
    at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:122)
    at com.sun.proxy.$Proxy133.prepareStatement(Unknown Source)

为什么在报名方法期间AtomikosConnectionProxy中出现此错误并且Atomikos异常?

 AtomikosSQLException.throwAtomikosSQLException("The transaction has timed out - try increasing the timeout if needed");

1 个答案:

答案 0 :(得分:0)

似乎有一个超时,因为您的应用程序使用事务的时间太长了。尝试增加交易超时时间?