1 Reply Latest reply on Apr 2, 2019 5:57 AM by jayshree

    Creating DB2 XA Datasource using JBoss-cli

    sambati

      Hello,  I am trying to create DB2 XA Datasource using Jboss-cli in JBoss EAP 7.1 environment.

      I am using the following command.

       

      /profile=full-ha/subsystem=datasources/xa-data-source=DB2DSXA3:add(jndi-name="java:/DB2DSXA3",connection-url="jdbc:db2://localhost:50000/TESTDB",driver-name=db2jccxa,is-same-rm-override="false",user-name=sambati,password=Summi135#,recover-plugin-class-name="org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin",valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker",stale-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker",exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter")

       

      Looks like some mandatory fields are missing in the command.  i am getting the following message.  

       

       

      connection-url' is not found among the supported properties: [allocation-retry, allocation-retry-wait-millis, allow-multiple-users, authentication-context, background-validation, background-validation-millis, blocking-timeout-wait-millis, capacity-decrementer-class, capacity-decrementer-properties, capacity-incrementer-class, capacity-incrementer-properties, check-valid-connection-sql, connectable, connection-listener-class, connection-listener-property, credential-reference, driver-name, elytron-enabled, enabled, enlistment-trace, exception-sorter-class-name, exception-sorter-properties, flush-strategy, idle-timeout-minutes, initial-pool-size, interleaving, jndi-name, max-pool-size, mcp, min-pool-size, new-connection-sql, no-recovery, no-tx-separate-pool, pad-xid, password, pool-fair, pool-prefill, pool-use-strict-min, prepared-statements-cache-size, query-timeout, reauth-plugin-class-name, reauth-plugin-properties, recovery-authentication-context, recovery-credential-reference, recovery-elytron-enabled, recovery-password, recovery-plugin-class-name, recovery-plugin-properties, recovery-security-domain, recovery-username, same-rm-override, security-domain, set-tx-query-timeout, share-prepared-statements, spy, stale-connection-checker-class-name, stale-connection-checker-properties, statistics-enabled, track-statements, tracking, transaction-isolation, url-delimiter, url-property, url-selector-strategy-class-name, use-ccm, use-fast-fail, use-java-context, use-try-lock, user-name, valid-connection-checker-class-name, valid-connection-checker-properties, validate-on-match, wrap-xa-resource, xa-datasource-class, xa-resource-timeout]

       

       

      can some one please help me  to fix it?

        • 1. Re: Creating DB2 XA Datasource using JBoss-cli
          jayshree

          Hi,

           

          It seems like you are missing "xa-datasource-properties" attribute. Following is the example of creating XA datasource:

           

          Create a module for the driver:

           

          module add --name=MODULE_NAME --resources=PATH_TO_JDBC_JAR --dependencies=DEPENDENCIES

           

          Register the driver:

           

          /subsystem=datasources/jdbc-driver=DRIVER_NAME:add(driver-name=DRIVER_NAME,driver-module-name=MODULE_NAME,driver-xa-datasource-class-name=XA_DATASOURCE_CLASS_NAME, driver-class-name=DRIVER_CLASS_NAME)

           

          Define the datasource:

           

          xa-data-source add --name=XA_DATASOURCE_NAME --jndi-name=JNDI_NAME --driver-name=DRIVER_NAME --xa-datasource-class=XA_DATASOURCE_CLASS --xa-datasource-properties={"ServerName"=>"HOST_NAME","DatabaseName"=>"DATABASE_NAME"}

           

          Note: In a managed domain, you will need to specify the profile to use. Depending on the format of the management CLI command, you will either precede the command with /profile=PROFILE_NAME or pass in the --profile=PROFILE_NAME argument.

           

          Set XA datasource properties:

           

          Set the server name:

           

            /subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-properties=ServerName:add(value=HOST_NAME)

           

          Set the database name:

           

            /subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-properties=DatabaseName:add(value=DATABASE_NAME)