4 Replies Latest reply on Nov 24, 2014 10:24 AM by aqtwrdnr aqtwrdnr

    How to use a different version (slot) of a datasource driver?

    aqtwrdnr aqtwrdnr Newbie

      Hello,

       

      In relation to my previous (until now unanswered) question: How to load an embedded h2 database dynamically from a singleton EJB.

       

      I am trying to use a newer version of h2 databse than the one provided with JBoss 7.2.0.Final. I have installed the newer version of the h2 module by placing a module.xml (together with h2-1.3.176.jar) in the $JBOSS_HOME/modules/com/h2database/h2/1.3.176 folder with the following contents:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.1" name="com.h2database.h2" slot="1.3.176">

          <resources>

              <resource-root path="h2-1.3.176.jar"/>

              <!-- Insert resources here -->

          </resources>

          <dependencies>

              <module name="javax.api"/>

              <module name="javax.transaction.api"/>

              <module name="javax.servlet.api" optional="true"/>

          </dependencies>

      </module>

       

      Now I would like to not use the 'main' version of the h2 module for my datasource, but version '1.3.176'. I cannot find any (official) documentation about how to achieve this, but I've tried adding the following configuration to the drivers section in the standalone.xml:

       

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

          <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

      </driver>

       

      Although the 'slot' attribute is not documented in the datasource XSD schema.

       

      However, it does not seem to pick it up, correctly.

       

      How can I check which version of the module is actually loaded? And how can I specify a slot in the driver element?

       

      Thanks in advance!

       

      Barry