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

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


    [ https://issues.jboss.org/browse/WFLY-6578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199263#comment-13199263 ] 

Mathieu Lachance commented on WFLY-6578:
----------------------------------------

I would not have open a JIRA ticket if the provided XSD was more instructive.
{code}
    <xs:attribute name="module" type="xs:token" use="optional">
      <xs:annotation>
        <xs:documentation>
          <![CDATA[[
            Specifies the name of AS7 module providing this driver.
            Thios tag is not used in IronJacamar standalone container.
           ]]>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
{code}

As you can see, it has obviously not been updated since some time...
Do you want me to raise another ticket for this?

Also, it's weird that no parsing exception are thrown when providing invalid configuration.
Do you want me to raise another ticket for that?


> 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