5 Replies Latest reply on Mar 16, 2012 2:38 PM by aloubyansky

    Adding a XA Datasource with the 7.1.0 beta

    mylos78

      Hi all,

      I'd like to know how to add an XA Datasource using the CLI. I can see that with the 7.1.0 Beta the --xa-datasource-properties is not available anymore, so the following example does not work any more on JBoss 7:

       

      xa-data-source add --jndi-name=java:/jboss/MyDS --pool-name=pool1 --xa-datasource-properties="URL"=>"jdbc:mysql://localhost:3306/DB","User"=>"root","Password"=>"admin"} --driver-name=mysql-connector-java-5.1.18-bin.jar

       

      thanks

      Mylos

        • 1. Re: Adding a XA Datasource with the 7.1.0 beta
          r.reimann

          The xa-datasource-properties param was removed in 7.1.0.Beta1. You have to add them as subrsources now:

           

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

           

          See also: http://community.jboss.org/message/639153#639153.

          • 2. Re: Adding a XA Datasource with the 7.1.0 beta
            mylos78

            Hello,

            thank you very much for your reply. I've tried with setting the properties, however it seems that the resource needs to be created before. However if I try with:

            [standalone@localhost:9999 /] /subsystem=datasources/xa-data-source=TestDS:add

            {

                "outcome" => "failed",

                "failure-description" => "JBAS014746: driver-name may not be null",

                "rolled-back" => true

            }

            So how can I add an XA datasource providing the information about the driver name at the same time ?

            Thanks

            Mylos

            • 3. Re: Adding a XA Datasource with the 7.1.0 beta
              r.reimann

              Hello Mylos,

               

              use the Tab Completion inside the CLI /subsystem=datasources/xa-data-source="TestDS":add(   ->TAB

              or the read-operation-description command /subsystem=datasources/xa-data-source=TestDS:read-operation-description(name=add)

              to get a list of valid parameters for the add operation.

               

              Below is an example with the required steps to create a xa datasource.

               

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

               

              Regards

              Robert

              • 4. Re: Adding a XA Datasource with the 7.1.0 beta
                mylos78

                Thank you very much !!!

                regards

                Mylos

                • 5. Re: Adding a XA Datasource with the 7.1.0 beta
                  aloubyansky

                  In AS7 7.1.2 xa-data-source will get --xa-datasource-properties argument, so the following will work

                   

                  xa-data-source add --name=myxa --jndi-name=java:/myxa --driver-name=h2 --xa-datasource-properties=ServerName=localhost,PortNumber=50111