We are facing the following exception in weblogic server v10.3.2.0. We are using JRockit JRE 6.0.
We have around 6-7 XA datasources involved in every server request. We face this exception when processing on the last datasource just begins.
Please someone advise.
java.sql.SQLException: Unexpected exception while enlisting XAConnection
java.sql.SQLException: Transaction rolled back: setRollbackOnly called on transaction
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1616)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.init(JtaTransaction.java:68)
at com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction.getConnection(JtaTransaction.java:131)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:120)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82)
As you wrote, the cause is unkown in this sample. We can see the transaction has been marked as "must roll back", probably by the previous datasources when something went wrong.
Maybe you can check previous logs, for the previous datasource, to find the cause ?