Uploaded image for project: 'HAL'
  1. HAL
  2. HAL-1716

HAL doesn't permit creation of working XA datasource

    XMLWordPrintable

Details

    • Hide
      • Define a driver using ojdbc8.jar but do not specify the Driver XA Datasource. You can directly deploy the JAR or use a module but in the driver don't define that property.
      module add --name=com.oracle --resources=/path/to/ojdbc8.jar --dependencies=javax.api,javax.transaction.api
      
      /subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle, driver-module-name=com.oracle)
      
      • Go to the console and create the datasource using the oracle template. It will fail with the root exception: IJ031101: XADataSourceClass is undefined.
      Show
      Define a driver using ojdbc8.jar but do not specify the Driver XA Datasource. You can directly deploy the JAR or use a module but in the driver don't define that property. module add --name=com.oracle --resources=/path/to/ojdbc8.jar --dependencies=javax.api,javax.transaction.api /subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle, driver-module-name=com.oracle) Go to the console and create the datasource using the oracle template. It will fail with the root exception: IJ031101: XADataSourceClass is undefined .
    • Undefined

    Description

      In WildFly 21.0.0, tried to create a simple Oracle XA datasource.

      At step 3 (JDBC Driver), there is an optional field for "Driver Class Name" and the default supplied is "oracle.jdbc.driver.OracleDriver"

      A driver class (i.e. an implementation of java.sql.Driver) cannot be used with an XA DataSource.

      • Instead an implementation of javax.sql.XADataSource must be supplied.
      • An XA DataSource class is required (it is mandatory not optional).
      • Even if the field retained the class (it doesn't - see below), it is confusing to call it a "Driver Class Name" as a "Driver Class" is distinctly different from an "XADataSource Class" (these are different Java interfaces). The two types cannot be used interchangeably.

      Users should be prompted to provide an appropriate class for their specific driver (e.g. oracle.jdbc.xa.client.OracleXADataSource). Supplying a default is not a good idea as it may change with driver releases.

      I tried to substitute the XA class in the "Driver Class Name" field but the required configuration is missing (looks like the field is ignored). The required configuration needs to appear as below (with the provided class):

                          <xa-datasource-class>SUPPLIED_CLASS_HERE</xa-datasource-class>
      

      Note that I'm not creating a module (which might work differently), I'm selecting the Oracle JDBC driver jar file (which I pre-copied to the WildFly standalone/deployments directory) from the drop down and I'm removing the module name as module deployments are a bit more complex than needed in most cases.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-rmartinc Ricardo Martin Camarero
              rhn-support-sfikes Stephen Fikes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: