12 Replies Latest reply on Apr 22, 2004 7:39 AM by adrian.brock

    Problem with XA and Oracle

    cjsceats

      Hi,

      I'm trying to configure access to an Oracle database using an XA data source in JBoss. However, whenever I try to access the database, I get an XAER_RMERR exception.

      My config and log file are follows...


      <xa-datasource>
      <jndi-name>OLTP</jndi-name>
      <track-connection-by-tx>true</track-connection-by-tx>
      <isSameRM-override-value>false</isSameRM-override-value>
      <xa-datasource-property name="URL">jdbc:oracle:thin:@myserver:myport:mySID</xa-datasource-property>
      <xa-datasource-property name="User">myuser</xa-datasource-property>
      <xa-datasource-property name="Password">mypassword</xa-datasource-property>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <no-tx-separate-pools/>
      </xa-datasource>


      13:52:01,059 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=wldn10002272//21, BranchQual=] errorCode=XAER_RMERR
      oracle.jdbc.xa.OracleXAException
      at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
      at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:143)
      at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1148)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:636)
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:455)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:483)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      at SequenceNumberBean.getSequenceNumber(SequenceNumberBean.java:70)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

        • 1. Re: Problem with XA and Oracle
          cjsceats

          A couple of things to add...

          - Yes, I have set Pad=true in the jboss-service.xml file!

          - It appears that the underlying exception is...
          Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: enlistResource failed; - nested throwable: (javax.resource.ResourceException: Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: enlistResource failed)

          Can anyone help?

          • 2. Re: Problem with XA and Oracle
            daniel-

            i have the same error ...
            it seems that oracle does not accept a XID that has a branch qualifier null. i did some stuffs on it but nothing to do, got alway that exception, we are working a few days on it but can not find what is wrong ....

            any help on it ?

            • 3. Re: Problem with XA and Oracle
              dikkedouwe

              Check your assembly-descriptor ... ensure either the <transe-attribute>NotSupported</transe-attribute> line is their or set transaction-type to Bean instead of Container... hope this helps :)

              • 4. Re: Problem with XA and Oracle
                dikkedouwe

                euh ... that should be <trans-attribute> and NotSupported is not the only option ...
                http://www.onjava.com/pub/a/onjava/2001/06/06/j2ee_trans.html?page=2

                • 5. Re: Problem with XA and Oracle
                  cjsceats

                  But by setting the transaction attribute to be "NotSupported", aren't I preventing a transaction from starting when my session bean is accessed??

                  • 6. Re: Problem with XA and Oracle
                    cjsceats

                    DikkeDouwe,

                    Your recommendation of setting the <trans-attribute> to "NotSupported" did solve the problem. However, I don't want transactions to be not supported!

                    In fact, the "Required" attribute (or "RequiresNew") is exactly what I want, because I want a transaction around the operation of my session bean. However, whenever I try this, it fails with the original error.

                    The other alternative, setting <transaction-type> to be "Bean" also seems like a pretty dumb idea, since the whole aim is to allow my XA transactions to be managed by the container, rather than me having to manage them myself!

                    Why shouldn't I be able to run a container-managed transaction within JBoss using Oracle as an XA resource?

                    Have I got the wrong end of the stick here or something?!?

                    • 7. Re: Problem with XA and Oracle
                      miffel

                      Hi, just wanted to let you know we have XA with Oracle 9i and MSSQL 2000 working. We have beans using "Required" and they work. I do remember having a similar problem, but that was a while back, so I can't really say how it was solved. Something nagging me though is that you shoud review your deployment descriptors carefully, even the ordering of elements in jboss*.xml (which has sometimes made a difference).

                      Do you have any special configs, like a special container-configuration?

                      • 8. Re: Problem with XA and Oracle

                        Oracle XA does not like the same XA connection used inside and outside
                        JTA transactions.
                        You can add <no-tx-separate-pools> in jboss-3.2.3 to work this problem.
                        You get one pool for connections when there is no transaction and another
                        for connections where there is a transaction.

                        Regards,
                        Adrian

                        • 9. Re: Problem with XA and Oracle
                          selvaatusa

                          I have the same error..do you any solutions for it


                          Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: enlistResource failed; - nested throwable: (javax.resource.ResourceException:

                          • 10. Re: Problem with XA and Oracle
                            guix

                             

                            "adrian@jboss.org" wrote:
                            Oracle XA does not like the same XA connection used inside and outside
                            JTA transactions.
                            You can add <no-tx-separate-pools> in jboss-3.2.3 to work this problem.
                            You get one pool for connections when there is no transaction and another
                            for connections where there is a transaction.

                            Regards,
                            Adrian


                            Adrian:
                            I have the same problem and adding <no-tx-separate-pools>false</no-tx-separate-pools> does not solve the problem for me.

                            any other ideas?

                            Best regards

                            • 11. Re: Problem with XA and Oracle
                              dxbcto

                              Hello,

                              I had a similar prolem.... please check my thread http://www.jboss.org/index.html?module=bb&op=viewtopic&t=48765. I hope it will help you.

                              Regards

                              • 12. Re: Problem with XA and Oracle

                                Can you stop posting ME TOO type posts on this thread.

                                If <no-tx-separate-pools/> does not solve your problem then you have a different
                                problem.
                                If you have a different problem why are you on this thread?