Description of problem: <url-selector-strategy-class-name> can be used to implement a custom strategy to choose the next database connection. But this configuration is ignored and the default implementation is used always. Version-Release number of selected component (if applicable): IronJacamar 1.0.26.Final-redhat-1 How reproducible: Always. Steps to Reproduce: 1. Extract customclass.zip into $JBOSS_HOME/modules/system/layers/base/org/jboss/ironjacamar/jdbcadapters/main and edit module.xml like this: ~~~ <resources> <resource-root path="customclass"/> <resource-root path="ironjacamar-jdbc-1.0.26.Final-redhat-1.jar"/> ~~~ 2. Edit standalone.xml like this: ~~~ <logger category="org.jboss.jca.adapters.jdbc"> <level name="DEBUG"/> </logger> ... <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE|jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <url-delimiter>|</url-delimiter> <url-selector-strategy-class-name>com.example.MyURLSelector</url-selector-strategy-class-name> ~~~ 3. Start the standalone server. Actual results: ~~~ 14:28:02,417 DEBUG [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (MSC service thread 1-5) Default URLSelectorStrategy is being used : URLSelector@400aa57f[urls=[jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE, jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE] currentUrl=null currentIndex=-1] ~~~ Expected results: MyURLSelector specified should be used. Additional info: When you check "urlSelectorStrategyClassName" attribute of "jboss.as:subsystem=datasources,data-source=ExampleDS" mbean by JConsole, its value is correct one, "com.example.MyURLSelector". In EAP 5, there was the same bug: https://issues.jboss.org/browse/JBPAPP-9384
Created attachment 980748 [details] customclass.zip
Some observations: 1. WildFly 8.2 doesn't have this class. It seems refactored drastically. 2. org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory#getURLDelimiter() returns "|" but #getUrlSelectorStrategyClassName() returns null, according to debugger.
Created attachment 988142 [details] JDBC module patch Try with this JAR as the replacement for the JDBC module
It works as expected with the patched one. Thanks. ~~~ 14:13:59,268 DEBUG [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (http-/127.0.0.1:8080-1) Customized URLSelectorStrategy is being used : MyURLSelector@33f7a992[urls=[jdbc:h2:mem:test;DB_CLOSE _DELAY=-1;DB_CLOSE_ON_EXIT=FALSE, jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE] currentUrl=null currentIndex=-1] ~~~
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1245 to Resolved
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1245 to Closed
verified on EAP 6.4.0.ER3