[jboss-jira] [JBoss JIRA] (JBAS-9502) Specifying url-selector-strategy-class-name in a local-tx-datasource does not work

Travis Rogers (JIRA) jira-events at lists.jboss.org
Thu Jun 21 21:16:13 EDT 2012


Travis Rogers created JBAS-9502:
-----------------------------------

             Summary: Specifying url-selector-strategy-class-name in a local-tx-datasource does not work
                 Key: JBAS-9502
                 URL: https://issues.jboss.org/browse/JBAS-9502
             Project: Application Server 3  4  5 and 6
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: JCA service
    Affects Versions: 6.1.0
         Environment: Windows 7
Oracle JDK 1.6.0_27
            Reporter: Travis Rogers
            Assignee: Jesper Pedersen
            Priority: Minor
             Fix For: No Release
         Attachments: JBAS-9452.patch

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.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list