Oracle WebLogic Server: How to clear pending XA transactions(Oracle Thin/XA Driver)?
来源:互联网 发布:python批量替换字符串 编辑:程序博客网 时间:2024/06/14 11:30
If you are using XA transactions in your JDBC datasource and you are using Oracle Thin/XA Driver, and you have errors, for example:
java.sql.SQLException: Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceDeadException: Pool testJDBCDataSource is disabled, cannot allocate resources to applications.Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'testJDBCDataSource': XAER_RMERR : A resource manager error has occured in the transaction branch oracle.jdbc.xa.OracleXAExceptionUnexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'testJDBCDataSource': XAER_RMERR : A resource manager error has occured in the transaction branchoracle.jdbc.xa.OracleXAException
When the Weblogic Server unclean pending XA transactions. How It fix?
First you need to enable XA in the database:
- Log on to database as system user
- Execute sql script xaview.sql in ORACLE_HOME/rdbms/admin
- Execute sql:
grant select on v$xatrans$ to public (or <user>);
- Execute sql:
grant select on pending_trans$ to public;
- Execute sql:
grant select on dba_2pc_pending to public;
Here are the details.
Any database account performing distributed transactions must have the following privileges:
- Execute sql:
grant select on dba_pending_transactions to public;
- Execute sql:
grant force any transaction to public (or <user>);
Second, you need to enable cleaning unfinished/pending transactions in WebLogic Server.
- Enable Recover Only Once for the JDBC data source.
- Enable XA End Only Once for the JDBC data source.
Why enable “Recover Only Once”?
The WebLogic Server transaction manager retries the commit call every minute, until a valid XAResource instance is registered with the WebLogic Server transaction manager, if the setting “Recover only once” is allowed and the commit call failure then the Weblogic Server transaction manager calls recover on the resource only once and not every minute.
More information about the recovery are here.
How to select pending XA transaction in DB?
select count(*) , min(fail_time),max(fail_time) from dba_2pc_pending;
转载自:http://www.tomecode.com/2010/10/30/oracle-weblogic-server-how-to-clear-pending-xa-transactionsoracle-thinxa-driver/
- Oracle WebLogic Server: How to clear pending XA transactions(Oracle Thin/XA Driver)?
- Oracle XA例子
- oracle XA session priviledge
- Tuxedo非XA连接Oracle
- 【转】Oracle XA JTA事务报错 不支持XA事务
- XA
- XA
- XA
- XA
- How to deploy MapViewer to Oracle WebLogic Server
- WebSphere下配置 Oracle XA数据源
- Sybase ASE的XA Transactions(分布式事务处理)
- XA中使用dblink发现的一个oracle bug
- 官网翻译 xa分布式事务的限制点( Restrictions on XA Transactions )
- weblogic XA驱动的一个报错
- Distributed transactions in Spring, with and without XA
- Distributed transactions in Spring, with and without XA
- SQL Server的分布式XA事务
- Kafka安装过程
- Pre-built.2网络库在cocos2dx中的使用
- 雅克比矩阵、海森矩阵与非线性最小二乘间的关系与在SFM和Pose Estimation中的应用
- CreateFileMapping在N个进程间共享一个HWND类型内存
- 让程序员少走弯路的14个忠告
- Oracle WebLogic Server: How to clear pending XA transactions(Oracle Thin/XA Driver)?
- Xcode6为什么干掉Prefix.pch文件&如何添加pch文件
- codeforces 508 D. Tanya and Password (fleury算法)
- sublime text创建属于自己的插入时间的小插件
- Java_集合操作_使遍历Map时取出的元素顺序与放入时一致
- 领导的境界
- (14) Java 动态代理(JDK)
- Spring Aop实例
- 能长成这样的手机,恐怕只有Project Ara了