2 Replies Latest reply on Jan 7, 2008 7:50 AM by kadlecp

    getting XADataSource from JNDI

      Hello,

      I would like to get an object implementing XADataSource interface from JNDI.

      I use Oracle and XADataSource that I have under JNDI tree is implemented by class: org.jboss.resource.adapter.jdbc.WrapperDataSource. Unfortunately the class does not implement XADataSource interface.
      I use standard oracle-xa-ds.xml, which is provided by JBoss in examples directory.....

      Background... The reason I would like to do it is to force hibernate to use XAConnections. The discussion to that topic http://forum.hibernate.org/viewtopic.php?t=966721&view=previous&sid=b32f84087e6505d30aa29b5e0540eb13
      (I would to have two message driven beans using hibernate object/db mapping working in one distributed transaction).

      Please would you help me?
      Thanks a lot.
      Pavel

        • 1. Re: getting XADataSource from JNDI
          vickyk

           

          "kadlecp" wrote:
          Hello,
          I would like to get an object implementing XADataSource interface from JNDI.

          You don't need to do that .
          Connections obtained from the xa-datasource Or local-xa-datasource enlists the XAResource associated with the Connection in the ongoing Transaction (TM) , this is mentioned in the JCA specs .
          From the Hibernate post I can make out that you need to configure the JOTM within Jboss .
          All you need to do is to configure the JOTM in Jboss , then things would work perfectly . I would not advice you to go with JOTM (TM) implementaion , you can go with the Arjuna which comes with Jboss as default .
          I am unable to find the link explaining the configurations details of JOTM in Jboss .



          • 2. Re: getting XADataSource from JNDI

            Hello,

            thank you very much. You have turned me on right way. I have succesfully run the distributed transaction in two message driven beans.
            I had to make some changes to com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinar
            I don't know if it is bug or not. I hope somebody will tell me on the JBoss Transaction forum.
            The discussion is here
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=126983