Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1182879 - url-selector-strategy-class-name is ignored and default URLSelectorStrategy is being used
url-selector-strategy-class-name is ignored and default URLSelectorStrategy i...
Status: VERIFIED
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity unspecified
: ER3
: EAP 6.4.0
Assigned To: Jesper Pedersen
Martin Simka
:
Depends On:
Blocks: 1184128
  Show dependency treegraph
 
Reported: 2015-01-16 00:57 EST by Osamu Nagano
Modified: 2015-02-27 08:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBJCA-1245 Major Closed Custom URL selector doesn't take effect 2017-12-12 00:00 EST

  None (edit)
Description Osamu Nagano 2015-01-16 00:57:14 EST
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 00:57:53 EST
Created attachment 980748 [details]
customclass.zip
Comment 2 Osamu Nagano 2015-01-19 03:07:33 EST
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 10:02:03 EST
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 00:20:53 EST
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 08:14:25 EST
Jesper Pedersen <jpederse@redhat.com> updated the status of jira JBJCA-1245 to Resolved
Comment 7 JBoss JIRA Server 2015-02-16 09:07:18 EST
Jesper Pedersen <jpederse@redhat.com> updated the status of jira JBJCA-1245 to Closed
Comment 8 Martin Simka 2015-02-27 08:11:39 EST
verified on EAP 6.4.0.ER3

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