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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: EAP_EWP 5.1.2
    • Fix Version/s: EAP_EWP 5.2.0
    • Component/s: JCA
    • Labels:
      None
    • Affects:
      Release Notes
    • Release Notes Text:
      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.
    • Release Notes Docs Status:
      Documented as Resolved Issue
    • Docs QE Status:
      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jeff.zhang Jeff Zhang
                  Reporter:
                  trogers-rh Travis Rogers
                  Writer:
                  Eva Kopalova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: