2 Replies Latest reply on Jun 9, 2004 12:28 PM by ithamar

    Problem using XAConnection with Oracle

    ithamar Newbie

      I am trying to use an XAConnection with Oracle. The reason why i want to do this is because i use a JMS component that needs to interact with the database.

      After receiving a lot of warnings because i was using a local connection i change to XA connection.

      Now i have this problem when the Message Driven Bean is closing the connection:

      ERROR [TxConnectionManager] ResourceException while closing connection handle!
      javax.resource.resource.ResourceException: Failure to delist resource

        • 1. Re: Problem using XAConnection with Oracle
          Adrian Brock Master

          Moderated: There is not enough information to answer your question.
          This normally suggests you haven't made any effort to understand the problem.
          Use READ THIS FIRST

          • 2. Re: Problem using XAConnection with Oracle
            ithamar Newbie

            I will try to be more explicit.

            I am using the jbossmq implementation of the JMS standart.

            I want to comunicate two modules of my application Asynchronously.

            I implement a Message Driven Bean to consume the messages that are sent by the rest to the aplication and insert the information in the DataBase.

            My Database server is Oracle 9i running in Linux operating system.
            My Aplication Server is Jboss 3.2.3 running Linux operating system.
            I am using oci Driver to connect the application server with the database server.

            My application it seems that was working fine but i am getting this warning when i check the log files

            18:56:47,578 WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.

            I search in the documentation and in the Internet and i found this page
            http://www.jboss.org/wiki/Wiki.jsp?page=GetquotWARNPrepareCalledOnALocalTx.quotWhenUsingJMSWithJDBC
            where is explained that the problem is that my connnection to the database does not support two phase commit.

            I was using local-tx-datasources and taht was the problem because those datasources does not support two phase commit.

            So i change my datasource configuration to use XA-Datasources.
            I change the database server accordingly (to support XA connections) and now i am getting this error

            2004-06-04 18:45:44,265 ERROR [MyClass] There was a problem interacting with the database.
            MyClass: org.jboss.util.NestedSQLException: Failure to delist resource; - nested throwable: (javax.resource.ResourceException: Failure to delist resource)
            at MyClass.method1(Unknown Source)
            at MyClass.method2(Unknown Source)
            at MyClass.method3(Unknown Source)
            at MyClass.onMessage(Unknown Source)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
            at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
            at org.jboss.ejb.Container.invoke(Container.java:713)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:914)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1208)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:276)
            at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:871)
            at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:159)
            at org.jboss.mq.SpySession.run(SpySession.java:347)
            at org.jboss.jms.asf.StdServerSession.run0(StdServerSession.java:200)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
            at java.lang.Thread.run(Thread.java:534)
            Caused by: org.jboss.util.NestedSQLException: Failure to delist resource; - nested throwable: (javax.resource.ResourceException: Failure to delist resource)
            at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
            ... 29 more
            Caused by: javax.resource.ResourceException: Failure to delist resource
            at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.delist(TxConnectionManager.java:487)
            at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionDisconnected(TxConnectionManager.java:352)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:504)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:885)
            at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
            ... 29 more


            I have read the jboss documentation over and over again and there is not any useful information that could help me
            to solve my problem.

            Can you help me or at least tell me where i cand find documentation about this problem.

            Thanxs in advance