Oracle WebLogic Server: How to clear pending XA transactions(Oracle Thin/XA Driver)?
2015-01-29 17:58
429 查看
If you are using XA transactions in your JDBC
datasource and you are using Oracle Thin/XA Driver, and you have errors, for example:
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:
Execute sql:
Execute sql:
Here are the details.
Any database account performing distributed transactions must have the following privileges:
Execute sql:
Execute sql:
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?
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.OracleXAException 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 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/
相关文章推荐
- How to deploy MapViewer to Oracle WebLogic Server
- Weblogic Server in the Chinese show how to solve the problem hash
- How to stop&start Oracle EBS Server(DB Server&Apps Server)
- [转]How to nest transactions nicely - "begin transaction" vs "save transaction" and SQL Server
- How to install Microsoft's SQL Server Driver for PHP
- How to add Oracle JDBC driver in your Maven local repository
- How to Clear the Application Server Cache Without Shutting it Down
- How to add Oracle JDBC driver in your Maven local repository
- How to setup linked servers for SQL Server and Oracle 64 bit client
- How to enable Weblogic Server debugs using WebLogic Console
- How to stop&start Oracle EBS Server(DB Server&Apps Server)
- How to install Oracle Database Server software silently with customized listener configuration
- How to check Oracle Applications Web Server Version ?
- Maven_How To Add Oracle JDBC Driver In Your Maven Local Repository
- How to get the oracle server version?
- How To Add Oracle JDBC Driver In Your Maven Local Repository
- How to Force Shutdown WebLogic Managed Server
- How to setup linked servers for SQL Server and Oracle 64 bit client
- How to setup linked servers for SQL Server and Oracle 64 bit client
- How to reduce number of records on CTXSYS.DR$WAITING,CTXSYS.DR$PENDING tables in Oracle EBS?