1 Reply Latest reply on Oct 5, 2012 3:44 AM by urbanq

    Oracle XA ds, ojdbc 11.2.0.3.0, jboss-6.0.0.Final, multiple connection properties

    work_registries

      How can i set multiple connection properties for an oracle xa datasource:

       

      For a single properties, the following works, as described elsewhere here in forums:

      <xa-datasource-property name="ConnectionProperties">oracle.jdbc.ReadTimeout=5000</xa-datasource-property>

       

      but setting multiple properties fails, tried the following:

       

      A) (only last one seems to count here)

       

      <xa-datasource-property name="ConnectionProperties">oracle.jdbc.ReadTimeout=5000</xa-datasource-property>

      <xa-datasource-property name="ConnectionProperties">oracle.jdbc.J2EE13Compliant=true</xa-datasource-property>

       

      B) fails: java.lang.NoSuchMethodException: oracle.jdbc.xa.client.OracleXADataSource.setOracle.jdbc.J2EE13Compliant(java.lang.String)

       

      <xa-datasource-property name="ConnectionProperties"><![CDATA[

      oracle.jdbc.ReadTimeout=5000

      oracle.jdbc.J2EE13Compliant=true]]></xa-datasource-property>

       

      C) fails: java.lang.NoSuchMethodException: oracle.jdbc.xa.client.OracleXADataSource.setOracle.jdbc.J2EE13Compliant(java.lang.String)

       

      <xa-datasource-property name="ConnectionProperties">

      oracle.jdbc.ReadTimeout=5000

      oracle.jdbc.J2EE13Compliant=true</xa-datasource-property>

       

      D) fails: java.lang.NumberFormatException: For input string: "5000;oracle.jdbc.J2EE13Compliant=true"

       

      <xa-datasource-property name="ConnectionProperties">oracle.jdbc.ReadTimeout=5000;oracle.jdbc.J2EE13Compliant=true</xa-datasource-property>

       

      E) fails

      <xa-datasource-property name="ConnectionProperties">oracle.jdbc.ReadTimeout=5000\noracle.jdbc.J2EE13Compliant=true</xa-datasource-property>

       

      How to do it?

        • 1. Re: Oracle XA ds, ojdbc 11.2.0.3.0, jboss-6.0.0.Final, multiple connection properties
          urbanq

          I have the same problem in jboss 5.1.0.GA.

          Found that XADataSourceDeploymentMetaData is setting 'XADataSourceProperties' property with pattern(getManagedConnectionFactoryProperties() method):

          name+ "=" + value+ "\n".

          So if you define:

          <xa-datasource-property name="ImplicitCachingEnabled">true</xa-datasource-property>

          <xa-datasource-property name="MaxStatements">32</xa-datasource-property>

          <xa-datasource-property name="ConnectionProperties">defaultRowPrefetch=100\noracle.jdbc.StreamBufferSize=30</xa-datasource-property>

           

          it will set:  XADataSourceProperties="ImplicitCachingEnabled=true\nMaxStatements=32\nConnectionProperties=defaultRowPrefetch=100\noracle.jdbc.StreamBufferSize=30"

          and setting properties on OracleXADS will be:

          xds.setImplicitCachingEnabled(true);

          xds.setMaxStatements(32);

          xds.setConnectionProperties(java.util.Properties(defaultRowPrefetch=100));

          xds.setOracle.jdbc.StreamBufferSize(30); <- !! no such method exception!

           

          as we expect:

          xds.setImplicitCachingEnabled(true);

          xds.setMaxStatements(32);

          xds.setConnectionProperties(java.util.Properties(defaultRowPrefetch=100,oracle.jdbc.StreamBufferSize=30));

           

          I didn't found any workaroud for this problem.

          OracleXADataSource API is broken and only way is to JBoss will take care of it