Search code examples
oracle-databasemodulejbossupgrade

Upgrade JDBC Driver module in Jboss EAP 6


Our application is deployed as an EAR and runs on Jboss EAP 6. Few years back Oracle jdbc driver was added as a core module in Jboss, path com/oracle. In standalone.xml the datasource is configured with the driver that points to the module name as mentioned below -

<datasource   ....>
    <drivers>
        <driver name="testOracleDriver" module="com.oracle">
        <xa-datasource-class>oracle.jdbc.driver.OracleDriver</xa-datasource-class>
    </driver>
</datasource

Oracle driver is also added as a maven dependency in pom file and the oracle driver jar is added as a module in application.xml. This application.xml is placed in EAR's META-INF folder.

Now there is a requirement to upgrade oracle driver version to 19. To achieve this can we just upgrade the desired oracle driver dependency in pom.xml with version 19. Will the application then use the oracle 19 driver as it will be specified as a module in application.xml that is placed EAR's META-INF? Since the datasource refers to oracle module, should we also update module.xml (under com/oracle/main) with the correct JAR version and drop the correct JAR in this module?

Any guidance will be greatly appreciated.


Solution

  • We had a similar requirement in our project to update to oracle 12c. We Updated dependency in pom.xml and also updated datasource in standalone.xml, something like this-

    <drivers>
            <driver name="testOracleDriver" module="com.oracle" slot="oracle19">
            <xa-datasource-class>oracle.jdbc.driver.OracleDriver</xa-datasource-class>
        </driver>
    

    The slot given here is the folder you can create inside Jboss modules on path com/oracle/oracle19. And then add new jdbc driver and module.xml inside.

    We did not add any entry in application.xml as Jboss will load datasource by default because of the entry in standalone.xml