weblogic XA驱动的一个报错

来源:互联网 发布:网络教育学费怎么交的 编辑:程序博客网 时间:2024/06/08 06:45
 [ERROR] 2015-08-27 11:49:23:206 org.hibernate.engine.jdbc.spi.SqlExceptionHelper (SqlExceptionHelper.java:144) - 
Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA start() failed on resource 'xxx_data_source': XAER_NOTA : The XID is not valid oracle.jdbc.xa.OracleXAException

解决方法:找到设置XA事务处理超时选项打钩,设置XA事务处理超时设置为0,点击保存即可。

转到底部转到底部

In this Document

Symptoms Cause Solution References


APPLIES TO:

Oracle SOA Suite - Version 11.1.1.3.0 and later
Information in this document applies to any platform.

SYMPTOMS

WebLogic Datasource errors appearing in SOA server log:

java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA start() failed on resource 'SOADataSource_base_domain': XAER_NOTA : The XID is not valid


ERROR
-----------------------

2011-12-16T00:01:33.791+10:30] [soa_server1] [ERROR] [] [oracle.soa.bpel.engine.dispatch] [tid: orabpel.invoke.pool-4.thread-13] [userId: <anonymous>] [ecid: 0000JH1ufkSD4iP5Mf9Die1EuSQh0001xR,0:7:100000066] [APP: soa-infra] [dcid: 5f7dda500ef01573:-39ff5479:1344130a57d:-7ffc-0000000000000011] <DispatchHelper::handleMessage> failed to handle message[[
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA start() failed on resource 'SOADataSource_base_domain': XAER_NOTA : The XID is not valid
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1532)
Error Code: 0
Internal Exception: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA start() failed on resource 'SOADataSource_base_domain': XAER_NOTA : The XID is not valid
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1532)
Error Code: 0
Caused by: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA start() failed on resource 'SOADataSource_base_domain': XAER_NOTA : The XID is not valid
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1532)
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_NOTA sta

 

CAUSE

According to XA protocol it requires that all the SQL statements for one and the same transaction branch be issued between an xa_start() and an xa_end() call.
In case of a distributed transaction, every individual database represents one XAResource that will have one transaction branch in one distributed transaction. Now the WebLogic Server transaction manager considers every JDBC DataSource as a separate XAResource, which means it cannot evaluate if different connection pools or data sources point to the same database.

This error can be seen when the transaction has timed out but the exception is not caught by the application.

SOLUTION

The solution is for the JDBC Connection Pools to set the XASetTransactionTimeout to true and XATransactionTimeout to zero (when this parameter is set to zero, the XAResource Session Timeout will be set to the global transaction timeout).

a. Log into WLS Administration Console
b. Click on Services -> Data Sources and then click on data source in question
c. Click on Transaction Tab
d. Click on check box next to "Set XA Transaction Timeout"
e. Make sure that "XA Transaction Timeout" has a value of 0
f. Save the configuration.
g. Bounce SOA


A general rule to follow is to make sure that WebLogic Server JTA timeout (either global, specific to an EJB or for individual 


0 0
原创粉丝点击