After the upgrade, we keep getting occasional XA resource errors like
this:
java.sql.SQLException: enlist: caught Exception
at com.ibm.ws.rsadapter.AdapterUtil.toSQLException(AdapterUtil.java:
1266)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:
676)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:
2038)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:
1993)
at
se.saab.air.messageRepository.db.MessageRepositoryDb.getNextSequenceNumber(MessageRepositoryDb.java:
227)
Caused by:
javax.resource.ResourceException: enlist: caught Exception
at
com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:
794)
at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:
1859)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:
2180)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:
619)
... 31 more
Caused by:
javax.transaction.SystemException: XAResource start association
error:XAER_PROTO
at
com.ibm.ws.Transaction.JTA.RegisteredResources.startRes(RegisteredResources.java:
1274)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.enlistResource(RegisteredResources.java:
637)
at
com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.java:
3284)
at
com.ibm.ws.Transaction.JTA.TranManagerSet.enlist(TranManagerSet.java:
397)
at
com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:
693)
... 34 more
Caused by:
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:
938)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:
244)
at
com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start(WSRdbXaResourceImpl.java:
1324)
at
com.ibm.ejs.j2c.XATransactionWrapper.start(XATransactionWrapper.java:
1467)
at
com.ibm.ws.Transaction.JTA.JTAResourceBase.start(JTAResourceBase.java:
145)
at
com.ibm.ws.Transaction.JTA.RegisteredResources.startRes(RegisteredResources.java:
1223)
... 38 more
(stacktrace shortened somewhat for legibility)
The code in question stores messages retrieved from MQ into an Oracle
database. The messages are received from JMS through a message driven
bean, and passed to a method on a session EJB. The session bean does
the storage by calling some classes that basically just are wrappers
around plain old JDBC methods. The session bean method has
"transaction required" set in the deployment descriptor. The SQL code
that fails is a simple "SELECT XXX.nextval FROM dual" sequence access.
The JDBC provider settings in the server are:
Name: Oracle JDBC Driver (XA)
Class path: /opt/IBM/WebSphere/database/ojdbc14.jar /opt/IBM/WebSphere/
database/orai18n.jar
Implementation class name: oracle.jdbc.xa.client.OracleXADataSource
The DataSource settings in the server are:
Data Store Helper: Oracle 10g
A component-managed authentication alias is set up and used
Authentication alias for XA recovery: use Component-managed
authentication alias
In the deployment descriptor, a resource reference is set up for the
session bean, pointing to the data source. The settings for the
reference are:
Type: javax.sql.DataSource
Authentication: Container
Sharing scope: Shareable
The Websphere bindings for the resource are left as per default, ie.
only the JNDI name is filled in.
Any ideas what to look for?