Distributed Transactions and Timeouts
来源:互联网 发布:制造业大数据解决方案 编辑:程序博客网 时间:2024/05/22 00:09
We're using JTA distributed transactions (across WebLogic 8.1 and Oracle), and we noticed that the following exception occasionally was causing us errors:
java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAER_NOTA : The XID is not valid start() failed on resource '[connection pool]': XAER_NOTA : The XID is not valid oracle.jdbc.xa.OracleXAException at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1017) at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:227) at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50)
Turns out that Oracle was timing out the transaction on its side of things. Here's ageneral description of the problem:
A general rule to follow is to make sure that WebLogic Server JTA timeout (either global, specific to an EJB or for individual transactions) is set to a lower value than the shortest timeout value configured/set for a participating XA resource (e.g., XA Transaction Timeout for Oracle XA JDBC connections). Not doing so can lead to an unexpected and inconsistent distributed transaction outcome, i.e., a participating XA Resource timing out before WebLogic Server JTA as the distributed transaction coordinator. The timed out XA Resource may take action to resolve its own part of the distributed transaction before WebLogic Server can take action. This will lead to heuristic error messages at the time when the WebLogic transaction manager tries to prepare/commit the distributed transaction.
The solution was that for the JDBC Connection Pools to set the XASetTransactionTimeout to true andXATransactionTimeout to zero ("When this parameter is set to zero, the XAResource Session Timeout will be set to the global transaction timeout.")
Hope this post helps save some people the hassle we went through to figure this out...
- Distributed Transactions and Timeouts
- Distributed Transactions and Timeouts
- Distributed Transactions
- Large-scale Incremental Processing Using Distributed Transactions and Notifications
- Distributed transactions in Spring, with and without XA
- Distributed transactions in Spring, with and without XA
- distributed-transactions-microservices-icebergs
- Intervals and timeouts
- 经典论文翻译导读之《Large-scale Incremental Processing Using Distributed Transactions and Notifications》
- Distributed transactions with multiple databases, Spring Boot, Spring Data JPA and Atomikos
- Distributed transactions with multiple databases, Spring Boot, Spring Data JPA and Atomikos
- 经典论文翻译导读之《Large-scale Incremental Processing Using Distributed Transactions and Notifications》 转载
- .net 2.0 的 Distributed Transactions(使用TransactionScope )
- Script to show Active Distributed Transactions
- Microsoft CRM 2011 Timeouts and Limits
- Distributed Database and Distributed Transaction
- Transactions and Exceptions
- Sessions and transactions
- htmlcxx 0.85的bug,断言_ASSERTE((unsigned)(c + 1) <= 256)错误
- Win7中无法安装oracle 10g 的问题
- FM Radio项目原创代码
- linux安装使用jprofiler6分析服务器应用状态(序列号)
- SQL Server中类型转换(将varchar值转换为数据类型为int的列时发生语法错误)
- Distributed Transactions and Timeouts
- 删除Java源代码中的注释
- C#读文件时出现中文乱码问题的解决方案
- C语言练习03:操作SQLite数据库
- Sybase isql 语法
- 可以左右滑动的ListView
- 快速排序
- hash处理海量数据及其实现
- 新发现