java.sql.SQLException:enlist:caught Exception

时间:2014-06-13 18:29:07

标签: sql sql-server-2008 websphere-7 sqlexception

在WAS7(websphere-7)中---尝试使用XATransactionFunction访问两个数据库。在其中一个我收到下面的错误。数据库都在XATransactionFunction下,数据库是XA启用的(根据我们的DBA)。当我尝试访问试图运行select查询的预准备语句时代码中断。 数据库:SQL Server 2008,驱动程序:sqljdbc4.0 我错过了什么?

请帮忙。

已经尝试过: 1.在应用程序ear文件中启用LPS,重新配置应用程序以接受启发式风险。

 String sql = createSelectSql(TABLE_WITH_SCHEMA_NAME, SINGLE_ROW_BY_VOUCHER_KEY_FIELD_NAMES);
    ps = dbConnection.prepareStatement(sql);


[6/13/14 12:07:00:503 MDT] 00000025 RegisteredRes E   WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
[6/13/14 12:07:00:614 MDT] 00000025 LocalTransact E   J2CA0030E: Method enlist caught com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
    at com.ibm.ws.tx.jta.RegisteredResources.enlistResource(RegisteredResources.java:864)
    at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1788)
    at com.ibm.ws.tx.jta.TranManagerSet.enlistOnePhase(TranManagerSet.java:615)
    at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:593)
    at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:2231)
    at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:2519)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:717)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2760)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2713)
    at ca.ab.gov.acs.cfm.voucher.VoucherHeader.findHeader(VoucherHeader.java:322)

0 个答案:

没有答案