Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-9384

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • EAP_EWP 5.2.0
    • EAP_EWP 5.1.2
    • JCA
    • None
    • Release Notes
    • Hide
      The <url-selector-strategy-class-name> property in a local-tx-datasource definition was ignored and the default implementation was used. This happened because the datasource deployer was setting the "UrlSelectorStrategyClassName" instead of "URLSelectorStrategyClassName" on the class BaseWrapperManagedConnectionFactory.java. This mistake has been fixed and the property is picked up and applied as expected.
      Show
      The <url-selector-strategy-class-name> property in a local-tx-datasource definition was ignored and the default implementation was used. This happened because the datasource deployer was setting the "UrlSelectorStrategyClassName" instead of "URLSelectorStrategyClassName" on the class BaseWrapperManagedConnectionFactory.java. This mistake has been fixed and the property is picked up and applied as expected.
    • Documented as Resolved Issue
    • NEW

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              jeff.zhang_jira Jeff Zhang (Inactive)
              rhn-support-trogers Travis Rogers (Inactive)
              Eva Kopalova Eva Kopalova (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: