6 Replies Latest reply on Nov 14, 2008 11:35 AM by jplater

    Setting up XA datasource with oranxo driver and RAC

    jplater

      I am trying to setup a XA datasource that uses the oraxno driver and connects to oracle RAC. I can't seem to figure out what the xml file should look like. I searched around and found http://www.jboss.org/community/docs/DOC-12246 but it doesn't show any examples with the oranxo drivers. Does anyone know how to do this or where I can find more information on how to do it? I have been able to get normal datasource to work with the oranxo driver and connect to RAC but I can't figure out how to do XA datasources. Judging by the oranxo documentation it looks like I should do something like:

       <xa-datasource-property name="User">USERNAME</xa-datasource-property>
       <xa-datasource-property name="Password">PASSWORD</xa-datasource-property>
       <xa-datasource-property name="Host">HOST</xa-datasource-property>
       <xa-datasource-property name="Port">PORT</xa-datasource-property>
       <xa-datasource-property name="Service">SERVICENAME</xa-datasource-property>
       <xa-datasource-property name="Failover">True</xa-datasource-property>
       <xa-datasource-property name="Host1">HOST1</xa-datasource-property>
       <xa-datasource-property name="Port1">PORT1</xa-datasource-property>
       <xa-datasource-property name="Host2">HOST2</xa-datasource-property>
       <xa-datasource-property name="Port2">PORT2</xa-datasource-property>
      


      But it doesn't work - it complains that setHost2() doesn't exist. Anyone have any success setting this up? Thanks.

        • 1. Re: Setting up XA datasource with oranxo driver and RAC
          vickyk

          Can you try setting URL property?

          <xa-datasource-property name="URL">jdbc:oracle:oci8:@tc</xa-datasource-property>

          And in the URL you can set what is explained in the docs for connection-url
          <connection-url>jdbc:oracle:thin:@(description=(address_list=(load_balance=on)(failover=on)(address=(protocol=tcp)(host=xxxxhost1)(port=1521))(address=(protocol=tcp)(host=xxxxhost2)(port=1521)))(connect_data=(service_name=xxxxsid)(failover_mode=(type=select)(method=basic))))</connection-url>


          Judging by the oranxo documentation it looks like I should do something like:

          Where is the oranxo documentation available, pass the link over here?


          • 2. Re: Setting up XA datasource with oranxo driver and RAC
            jplater

            I tried that the other day but oranxo doesn't support the URL property. Here is the link to the oranxo documentation.

            http://www.inetsoftware.de/products/jdbc/oracle/manual.asp

            • 3. Re: Setting up XA datasource with oranxo driver and RAC
              vickyk

              Well host2 property will not work as setHost2 is not here
              http://www.inetsoftware.de/products/jdbc/oracle/doc/com/inet/ora/OraDataSource.html

              Try setting
              <xa-datasource-property name="Properties">host1=host1name,port1=port1val,host2=host2name,port2=port2val</xa-datasource-property>
              http://www.inetsoftware.de/products/jdbc/oracle/doc/com/inet/ora/XDataSource.html

              If this does not work attach your complete -ds,xml, I will have a look at it later.

              Have you asked the help from the driver vendor?

              • 4. Re: Setting up XA datasource with oranxo driver and RAC
                jplater

                I found a way to get this working. Since oranxo doesn't have an api for setting host2 and port2, I added a wrapper class that exposed setHost2() and setPort2(). These methods just called setProperty("host2", ) and setProperty("port2", ) . Then I setup my ds file like the one I listed above and added <xa-datasource-class> which I set to my wrapper class. Thanks for your help.

                <?xml version="1.0"?>
                
                <datasources>
                 <xa-datasource>
                 <jndi-name>JNDI_NAME</jndi-name>
                 ...
                 <xa-datasource-class>WRAPPER_CLASS</xa-datasource-class>
                 <xa-datasource-property name="User">USERNAME</xa-datasource-property>
                 <xa-datasource-property name="Password">PASSWORD</xa-datasource-property>
                 <xa-datasource-property name="Host">HOST</xa-datasource-property>
                 <xa-datasource-property name="Port">PORT</xa-datasource-property>
                 <xa-datasource-property name="Service">SERVICENAME</xa-datasource-property>
                 <xa-datasource-property name="Failover">True</xa-datasource-property>
                 <xa-datasource-property name="Host1">HOST1</xa-datasource-property>
                 <xa-datasource-property name="Port1">PORT1</xa-datasource-property>
                 <xa-datasource-property name="Host2">HOST2</xa-datasource-property>
                 <xa-datasource-property name="Port2">PORT2</xa-datasource-property>
                 ...
                 </xa-datasource>
                </datasources>
                
                


                • 5. Re: Setting up XA datasource with oranxo driver and RAC
                  vickyk

                  I think setting properties is easy that having a wrapper, btw did you tried to setting the properties also?

                  • 6. Re: Setting up XA datasource with oranxo driver and RAC
                    jplater

                    I did try setting properties. It didn't work, it resulted in host1 being set to 'host1name,port1=port1val,host2=host2name,port2=port2'. I looked at the jboss source code and determined that there wasn't a way to set host2 and port2 without creating a wrapper class.