Bug 1182879 - url-selector-strategy-class-name is ignored and default URLSelectorStrategy is being used
Summary: url-selector-strategy-class-name is ignored and default URLSelectorStrategy i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER3
: EAP 6.4.0
Assignee: Jesper Pedersen
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks: 1184128
TreeView+ depends on / blocked
 
Reported: 2015-01-16 05:57 UTC by Osamu Nagano
Modified: 2019-08-19 12:42 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
customclass.zip (3.46 KB, application/zip)
2015-01-16 05:57 UTC, Osamu Nagano
no flags Details
JDBC module patch (189.95 KB, application/zip)
2015-02-04 15:02 UTC, Jesper Pedersen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBJCA-1245 0 Major Closed Custom URL selector doesn't take effect 2017-12-12 05:00:40 UTC

Description Osamu Nagano 2015-01-16 05:57:14 UTC
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

Comment 1 Osamu Nagano 2015-01-16 05:57:53 UTC
Created attachment 980748 [details]
customclass.zip

Comment 2 Osamu Nagano 2015-01-19 08:07:33 UTC
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.

Comment 4 Jesper Pedersen 2015-02-04 15:02:03 UTC
Created attachment 988142 [details]
JDBC module patch

Try with this JAR as the replacement for the JDBC module

Comment 5 Osamu Nagano 2015-02-05 05:20:53 UTC
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]
~~~

Comment 6 JBoss JIRA Server 2015-02-05 13:14:25 UTC
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1245 to Resolved

Comment 7 JBoss JIRA Server 2015-02-16 14:07:18 UTC
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1245 to Closed

Comment 8 Martin Simka 2015-02-27 13:11:39 UTC
verified on EAP 6.4.0.ER3


Note You need to log in before you can comment on or make changes to this bug.