JTA事务超时异常-weblogic 10.X

发布于 2024-08-21 14:19:13 字数 2286 浏览 15 评论 0原文

我从管理控制台更改了 JTA 事务超时并设置为 300,即使在更改失败后,也显示 JTA 事务意外回滚(可能由于超时):

weblogic.transaction.RollbackException: Transaction timed out after 181 seconds`

为了确保我的更改(超时值 300)是否得到反映域与否我在域 config.xml 下进行了检查,它得到了 300 的反映。

我的问题是,是否还有其他地方需要更新事务超时值以及是否需要重新启动服务器?

以下服务器异常后的完整堆栈跟踪:

Caused by: org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is weblogic.transaction.RollbackException: Transaction
 timed out after 180 seconds
BEA1-160A800A149091F72E5E
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1031)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:359)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy103.saveRegistryData(Unknown Source)
    at gov.cms.pqri.arch.submission.registry.bean.RegDataAccessManager.persistRegistry(RegDataAccessManager.java:54)
    ... 14 more
Caused by: weblogic.transaction.RollbackException: Transaction timed out after 180 seconds
BEA1-160A800A149091F72E5E
    at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1818)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:333)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:227)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:281)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)
    ... 22 more

I changed the JTA transaction timeout from admin console and set to 300, even after changing it fails saying JTA transaction unexpectedly rolled back (maybe due to a timeout) with a:

weblogic.transaction.RollbackException: Transaction timed out after 181 seconds`

To make sure whether my changes (timeout value 300) got reflected for that domain or not I checked under domain config.xml it got reflected with 300.

My question is, is there any other place also do I need to update the transaction timeout value and do I need to restart the server ?

Full stack trace after the exception from server below:

Caused by: org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is weblogic.transaction.RollbackException: Transaction
 timed out after 180 seconds
BEA1-160A800A149091F72E5E
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1031)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:359)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy103.saveRegistryData(Unknown Source)
    at gov.cms.pqri.arch.submission.registry.bean.RegDataAccessManager.persistRegistry(RegDataAccessManager.java:54)
    ... 14 more
Caused by: weblogic.transaction.RollbackException: Transaction timed out after 180 seconds
BEA1-160A800A149091F72E5E
    at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1818)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:333)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:227)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:281)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)
    ... 22 more

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

等待圉鍢 2024-08-28 14:19:13

将服务器下的卡住线程最大时间更改为 300 后 ->配置->从管理控制台调整(选项卡)它正在更新并且工作正常。

after changing the stuck Thread Max time to 300 under servers -> configuration -> tuning (tab) from admin console it is getting updated and working fine.

清秋悲枫 2024-08-28 14:19:13

我也遇到过这个问题并解决了同样的问题,因为这与 JTA 事务有关,所以我们需要增加 JTA 的超时以及卡住的最大线程的超时。请从 weblogic 控制台主页单击 JTA,并将 JTA 超时从 30(默认情况下)增加到 300

I have also came across this issue and have resolved the same, since this is related to JTA transaction so we need to increase the timeout of JTA as well along with the time out for stuck max thread. Please click on JTA from the weblogic console home and increase the JTA timeout from 30(by default) to 300.

和我恋爱吧 2024-08-28 14:19:13

我们在 Weblogic 12.1.2 上遇到了同样的问题 [JTA 事务意外回滚(可能是由于超时)] 经过所有调查,我们找到了问题的根本原因。在我看来,这是由于巨大的数据集处理事务和接近尾声而发生的如果抛出异常,JTA 会按预期回滚数据。但它没有给出错误的详细信息。在我们的例子中,这主要是由于数据库完整性引起的(例如,我们尝试将数据插入一列) 。

总而言之,这将是调查数据库日志的最佳方法,而不是增加卡住的线程最大时间。线程最大时间可以是一个解决方案,但不是真正企业系统的正确解决方案

此问题也在 另一个 stackover 链接hibernate jira 问题

并建议解决方案:

这是Weblogic JTA 实现的默认行为。获得
root 异常,您应该设置系统属性
weblogic.transaction.allowOverrideSetRollbackReason 为 true。

解决方案之一是将这一行添加到
/bin/setDomainEnv.cmd:

set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.transaction.allowOverrideSetRollbackReason=true

We met same issue on Weblogic 12.1.2 [JTA transaction unexpectedly rolled back (maybe due to a timeout)] after all investigation we found the root cause of the problem.In my opinion it occurs due to huge dataset processing transactional and near the end of the process If an exception is thrown, JTA is rolling back data as expected.But it does not give the details of the error.In our case ,it mostly cause because of the database integrity (e.g we try to insert data a column with smaller size than data.)

In summary,it will be the best way to investigate db logs instead of increasing stuck Thread Max time.Thread max time can be a solution,but not a proper solution for real enterprise systems.

Also this issue discussed on another stackover link and hibernate jira issue

And solution suggested:

This is a default behaviour of Weblogic JTA realization. To obtain
root exception you should set system property
weblogic.transaction.allowOverrideSetRollbackReason to true.

One of the solution is add this line into
/bin/setDomainEnv.cmd:

set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.transaction.allowOverrideSetRollbackReason=true
千柳 2024-08-28 14:19:13

通过将 jta.properties 文件添加到我的应用程序的配置文件夹中,我的 JTA 超时增加了:

com.atomikos.icatch.default_jta_timeout=600000
com.atomikos.icatch.max_timeout=600000

I got my JTA timeouts increased by adding jta.properties file into config folder of my app with lines:

com.atomikos.icatch.default_jta_timeout=600000
com.atomikos.icatch.max_timeout=600000
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文