5 Replies Latest reply on Oct 9, 2015 2:51 AM by frolovmx

    CLI rejects xa-data-source-properties in  JBoss AS 7.1.0.Beta1

    r.reimann

      When i try to add a XA-Datasource via the CLI in AS 7.1.0.Beta1 it fails if i provide xa-data-source-properties in the add operation:

       

      [standalone@localhost:9999 /] /subsystem=datasources/xa-data-source="TestDS":add(jndi-name="java:/TestDS", driver-name="h2", pool-name="testPool",xa-data-source-properties={"ServerName"=>"localhost"}) 
      
      'xa-data-source-properties' is not found among the supported properties: [xa-datasource-class, jndi-name, driver-name, new-connection-sql, pool-name, url-delimiter, url-selector-strategy-class-name, use-java-context, max-pool-size, min-pool-size, pool-prefill, pool-use-strict-min, interleaving, no-tx-separate-pool, pad-xid, same-rm-override, wrap-xa-resource, user-name, password, security-domain, reauth-plugin-class-name, reauth-plugin-properties, flush-strategy, prepared-statements-cache-size, share-prepared-statements, track-statements, allocation-retry, allocation-retry-wait-millis, blocking-timeout-wait-millis, idle-timeout-minutes, query-timeout, use-try-lock, set-tx-query-timeout, transaction-isolation, check-valid-connection-sql, exception-sorter-class-name, exception-sorter-properties, stale-connection-checker-class-name, stale-connection-checker-properties, valid-connection-checker-class-name, valid-connection-checker-properties, background-validation-millis, background-validation, use-fast-fail, validate-on-match, xa-resource-timeout, spy, use-ccm, recovery-username, recovery-password, recovery-security-domain, recovery-plugin-class-name, recovery-plugin-properties, no-recovery]
      

       

      The same command succedes in AS 7.0.2:

       

      [standalone@localhost:9999 /] /subsystem=datasources/xa-data-source="TestDS":add(jndi-name="java:/TestDS", driver-name="h2", pool-name="testPool",xa-data-source-properties={"ServerName"=>"localhost"}) 
      {"outcome" => "success"}
      

       

      Were there any intentional changes in 7.1.0.Beta1 or is this a bug?

        • 1. Re: CLI rejects xa-data-source-properties in  JBoss AS 7.1.0.Beta1
          maeste

          It's a change we have made in 7.1. Now xa-datasource-properties are subresources, no more parameter of add operation.

          It makes those properties manageable.

           

          regards

          S.

          • 2. Re: CLI rejects xa-data-source-properties in  JBoss AS 7.1.0.Beta1
            r.reimann

            Thanks, for the quick reply. Adding the properties as subresources worked:

             

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

            /subsystem=datasources/xa-data-source=TestDS/xa-datasource-properties=PortNumber:add(value=50011)

             

            Sorry if i'm asking beginners questions since it's my first day using AS7 and the CLI but is there a way to bulk add multiple properties at once without repeating the address for each property like above?

             

            I also wonder if (and how) the generic type xa-data-source command still supports xa-datasource-properties in 7.1?

            • 3. Re: CLI rejects xa-data-source-properties in  JBoss AS 7.1.0.Beta1
              maeste

              No there isn't a bulk change, but you can write a cli script of course.

               

              And no, xa-datasource-properties are not supported as part of add command, as said to make them maneageble (add/remove single property on an already created, and disabled, ds)

               

              regards

              S.

              • 4. Re: CLI rejects xa-data-source-properties in  JBoss AS 7.1.0.Beta1
                frolovmx

                Is it possible to congiure xa-datasource using DMR API?

                Executing the following operation:

                ModelNode op = new ModelNode();
                op.get("operation").set ("add");
                op.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName);
                op.get("jndi-name").set("java:jboss/datasources/" + datasourceName);
                op.get("driver-name").set("oracle");
                op.get("enable").set("false");
                op.get("xa-datasource-properties").add("URL", "jdbc:oracle:thin:@host:1521:serviceName");
                

                results in

                JBAS010469: At least one xa-datasource-property is required for an xa-datasource

                 

                If I understand properly, if I would add xa datasource using CLI I would use 2 commands in a batch. Is there something like batch operations in DMR API?

                • 5. Re: CLI rejects xa-data-source-properties in  JBoss AS 7.1.0.Beta1
                  frolovmx

                  A CLI batch is a composite DRM API operation.

                   

                  The following code works:

                   

                  ModelNode compositeOp = new ModelNode();

                  compositeOp.get("operation").set("composite");

                  compositeOp.get("address").setEmptyList();

                  final ModelNode steps = compositeOp.get("steps");

                   

                  ModelNode step1 = new ModelNode();

                  step1.get("operation").set ("add");

                  step1.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName);

                  step1.get("jndi-name").set("java:jboss/datasources/" + datasourceName);

                  step1.get("driver-name").set("oracle");

                  step1.get("enable").set("false");

                   

                  ModelNode step2 = new ModelNode();

                  step2.get("operation").set ("add");

                  step2.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName).add("xa-datasource-properties", "URL");

                  step2.get("value").set("jdbc:oracle:thin:@host:1521:service");

                   

                  ModelNode step3 = new ModelNode();

                  step3.get("operation").set ("add");

                  step3.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName).add("xa-datasource-properties", "User");

                  step3.get("value").set("username");

                   

                  ModelNode step4 = new ModelNode();

                  step4.get("operation").set ("add");

                  step4.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName).add("xa-datasource-properties", "Password");

                  step4.get("value").set("password");

                   

                  steps.add(step1).add(step2).add(step3).add(step4);

                   

                  client.execute(compositeOp);