English 中文(简体)
JTA 事务超时异常 - WebLogic 10.X
原标题:JTA transaction timeout exception - weblogic 10.X

我从管理控制台更改了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
最佳回答

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

问题回答

我也遇到了这个问题,并已解决,由于这与JTA事务相关,因此我们需要增加JTA的超时时间以及卡住最大线程的超时时间。请从weblogic控制台主页单击JTA并将JTA超时时间从30(默认)增加到300

我们在Weblogic 12.1.2上遇到了相同的问题[JTA事务意外回滚(可能是由于超时)],经过所有调查,我们找到了问题的根本原因。我认为这是由于处理大数据集事务性的问题,且在过程接近结束时如果出现异常,JTA会按预期回滚数据。但它不提供错误的详细信息。在我们的案例中,这主要是因为数据库完整性的问题(例如我们尝试将数据插入到列中,而其大小小于数据)。

总之,相比于增加线程最大停留时间,调查数据库日志将是最好的方法。线程最大停留时间可能是一种解决方案,但对于真正的企业系统来说,不是一个适当的解决方案。

此问题还在讨论中,您可以参考以下链接:Stackover链接Hibernate Jira问题

解决方案建议:

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

我通过将jta.properties案编成我有线的笔记,增加了我的JTA时间:

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




相关问题
WCF Transaction Flow Question

I would like to configure WCF service operations to accept a transaction if my client sends one, but not to create one if none is sent. I think this would be similar to the Supported transaction ...

question about pl/sql exception

the following text is an excerpt of oracle documentation Oracle® Database PL/SQL Language Reference 11g Release 1 (11.1) : Unhandled exceptions can also affect subprograms. If you exit a ...

SQL Server - transactions roll back on error?

We have client app that is running some SQL on a SQL Server 2005 such as the following: BEGIN TRAN; INSERT INTO myTable (myColumns ...) VALUES (myValues ...); INSERT INTO myTable (myColumns ...) ...

Cannot rollback transaction with Entity Framework

I have to do queries on uncommitted changes and I tried to use transactions, but I found that it do not work if there are exceptions. I made a simple example to reproduce the problem. I have a ...

mySQL - Prevent double booking

I am trying to work out the best way to stop double booking in my application. I have a table of unique id s each can be sold only once. My current idea is to use a transaction to check if the ...

热门标签