XA Problems in 3.2.0RC1
joey75205 Feb 24, 2003 2:28 PMHello,
I am trying to use an XA DataSource (with Oracle 9i). Here's the datasource definition:
<xa-datasource>
<jndi-name>jdbc/EstoreXADB</jndi-name>
<track-connection-by-tx>true</track-connection-by-tx>
<managedconnectionfactory-class>
org.jboss.resource.adapter.jdbc.xa.oracle.XAOracleManagedConnectionFactory
</managedconnectionfactory-class>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:oci:@myDB</xa-datasource-property>
<xa-datasource-property name="User">scott</xa-datasource-property>
<xa-datasource-property name="Password">tiger</xa-datasource-property>
</xa-datasource>
I have deployed a simple EJB that gets a handle to the datasource directly (java:/jdbc/EstoreXADB) and uses it. Whenever my business method is invoked, I get this error:
13:34:40,270 INFO [STDOUT] in ejbCreate()
13:34:40,280 INFO [STDOUT] in getAll()
13:34:45,948 INFO [STDOUT] got the connection
13:34:45,958 INFO [STDOUT] created the statement
13:34:45,958 INFO [STDOUT] executed the query
13:34:46,198 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo
rmatId=257, GlobalId=ELDIABLO//9, BranchQual=] errorCode=XAER_NOTA
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1157
)
at oracle.jdbc.xa.client.OracleXAResource.end(OracleXAResource.java:450)
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.end(XAManagedC
onnection.java:118)
at org.jboss.tm.TransactionImpl.endResource(TransactionImpl.java:1096)
at org.jboss.tm.TransactionImpl.endResources(TransactionImpl.java:1158)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:337)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
T.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:247)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
01)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
ryFinderInterceptor.java:154)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:303)
at org.jboss.ejb.Container.invoke(Container.java:680)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
340)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
at sun.rmi.transport.Transport$1.run(Transport.java:147)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:479)
13:34:46,209 ERROR [LogInterceptor] TransactionRolledbackException:
javax.transaction.TransactionRolledbackException: Unable to commit, tx=Transacti
onImpl:XidImpl [FormatId=257, GlobalId=ELDIABLO//9, BranchQual=] status=STATUS_N
O_TRANSACTION
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
T.java:368)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:247)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
01)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
ryFinderInterceptor.java:154)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:303)
at org.jboss.ejb.Container.invoke(Container.java:680)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
340)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
at sun.rmi.transport.Transport$1.run(Transport.java:147)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:479)
I can get this to work with Local transactions, but not XA transactions. Is there something wrong with the datasource setup? I have used the JDBC Driver class and URL in JBuilder to connect to the database, so those don't seem to be the problem. And yes, I have an assembly descriptor tag with container transactions set to "Required" for all methods on both the home and remote interfaces for the EJB. The conatiner does not seem to be creating the transaction for me.
I have alos attempted to set the transaction-type to "Bean" and get a handle to the UserTransaction. I get the same error.
Thanks,
Joey