[jboss-jira] [JBoss JIRA] (WFLY-6578) Add driver module slot configuration to Datasource subsystem

Mathieu Lachance (JIRA) issues at jboss.org
Fri Apr 29 13:58:00 EDT 2016


Mathieu Lachance created WFLY-6578:
--------------------------------------

             Summary: Add driver module slot configuration to Datasource subsystem
                 Key: WFLY-6578
                 URL: https://issues.jboss.org/browse/WFLY-6578
             Project: WildFly
          Issue Type: Feature Request
          Components: JCA
    Affects Versions: 10.0.0.Final
            Reporter: Mathieu Lachance
            Assignee: Jesper Pedersen


Currently, it is possible to define Datasource and Drivers as such in the standalone.xml:
{code}
        <subsystem xmlns="urn:jboss:domain:datasources:4.0">
            <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>
{code}

The driver module attribute allows to point to a well define module which is fine. Though it doesn't seems possible to point to another "slot" to be able to switch between multiple version of the same driver.

It would be nice if we could do so, ex:
{code}
                    <driver name="h2" module="com.h2database.h2" module-slot="1.0">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
{code}

Also, while playing with the configuration, I've noticed that whatever you put onto the driver definition will be safely discarded instead of throwing an XSD validation exception. I'm not sure this is the proper behavior as it could be very misleading, ex:
{code}
                    <driver name="h2" module="com.h2database.h2" module-slot="1.0">
{code}
Currenly doesn't throw any exception and is getting rewrited to:
{code}
                    <driver name="h2" module="com.h2database.h2">
{code}
Should a bug be opened for that? To me it looks a bit similar to: WFLY-4464 

The only workaround I'm aware of is to either:
1. create a new main module.xml that depends on the actual versioned slot
2. have the versioning scheme part of the dependency (ex: com/h2database-1.0/main)

Both solutions are not very elegant.

Thanks,




--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list