Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6578

Add driver module slot configuration to Datasource subsystem

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Won't Do
    • Major
    • None
    • 10.0.0.Final
    • JCA
    • None

    Description

      Currently, it is possible to define Datasource and Drivers as such in the standalone.xml:

              <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&gt;org.h2.jdbcx.JdbcDataSource</xa-datasource-class&gt;
                          </driver>
                      </drivers>
                  </datasources>
              </subsystem>
      

      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:

                          <driver name="h2" module="com.h2database.h2" module-slot="1.0">
                              <xa-datasource-class&gt;org.h2.jdbcx.JdbcDataSource</xa-datasource-class&gt;
                          </driver>
      

      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:

                          <driver name="h2" module="com.h2database.h2" module-slot="1.0">
      

      Currenly doesn't throw any exception and is getting rewrited to:

                          <driver name="h2" module="com.h2database.h2">
      

      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,

      Attachments

        Activity

          People

            jpederse@redhat.com Jesper Pedersen
            mathieu@mathieulachance.com Mathieu Lachance (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: