Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-9452

Specifying url-selector-strategy-class-name in a local-tx-datasource does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • No Release
    • 6.1.0
    • JCA service
    • None

      Here is an example of my data source configuration.

      <datasources>

      <local-tx-datasource>
      <jndi-name>as400/AS400-DS</jndi-name>
      <connection-url>jdbc:as400:primaryhost;prompt=false|jdbc:as400:secondaryhost;prompt=false</connection-url>
      <url-delimiter>|</url-delimiter>
      <url-selector-strategy-class-name>org.example.MyUrlSelectorStrategy</url-selector-strategy-class-name>
      <driver-class>com.ibm.as400.access.AS400JDBCDriver</driver-class>
      <user-name>my_user_name</user-name>
      <password>p4ssw0rd</password>
      <metadata>
      <type-mapping>DB2</type-mapping>
      </metadata>
      <background-validation-millis>15000</background-validation-millis>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>5</max-pool-size>
      <blocking-timeout-millis>1000</blocking-timeout-millis>
      <idle-timeout-minutes>5</idle-timeout-minutes>
      </local-tx-datasource>

      </datasources>

      When providing the 'url-selector-strategy-class-name' attribute in a local-tx-datasource definition, the value specified is ignored, and the default implementation ends up being used instead.

      After digging around in the code, I noticed that in connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java, the getManagedConnectionFactoryProperties method should call

      property.setName("UrlSelectorStrategyClassName");

      instead of

      property.setName("URLSelectorStrategyClassName");

      in order to properly set the property with the name 'urlSelectorStrategyClassName' on the class BaseWrapperManagedConnectionFactory.java.

      I've confirmed that, after making the change, the server reads in the property correctly and uses the associated class for URL selection strategy when connecting to the database with the configured URLs.

              jpederse@redhat.com Jesper Pedersen
              snyderr Rick Snyder (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: