5 Replies Latest reply on Jan 12, 2012 11:02 AM by rareddy

    Adding "resource-adapter" using CLI

    rareddy

      Ok, the title is wrong, actually what I am looking for is adding a "connection-factory" to the "resource-adapter" using CLI.  One can add a "resource-adapter" using code like

       

      /subsystem=resource-adapters/resource-adapter=teiid-connector-ws.rar:add(archive=teiid-connector-ws.rar,transaction-support=NoTransactions)
      

       

      However, I am not sure how one can add a "connection-factories" to it. If anybody can show a sample I really appreciate it.

       

      I looked though the code, I did not find any operations that were registered at the connection factory "sub-model" level. There is only "add" operation at the "resource-adapter" level, nothing below it. In Teiid, we have many resource-adapters, and each resource-adaptor can have many different connection factories. Each connection factory lifecycle is independent of each other, such that I should be able to add/remove "connection-factory" under a "resource-adapter", without disturbing other connection factories.

       

      The current model is very limiting, that you can probably add *one* connection factory along with resource-adapter once I know how to use CLI command, if I had to add another connection factory, I need to delete the old resource-adapter and add a new one with two connection factories. I do not think that is good.

       

      To do this correctly, we would need to register each connection factory as "sub-model" under the "resource-adapter" model, and add  "add", "remove" operations, and move operations like "flush-idle-connection-in-pool" from resource-adapter level to the connection factory level.

       

      Please correct me if my suggestion is wrong, and how we can proceed to address this issue.

       

      Ramesh..

        • 1. Re: Adding "resource-adapter" using CLI
          heiko.braun

          I think it related to https://issues.jboss.org/browse/AS7-1381. The same problem exist for other "sub-resources" too.

          Fell free to coment on this issue.

          • 2. Re: Adding "resource-adapter" using CLI
            maeste

            Yup Heiko is right.

             

            Watch that issue to know when it will be solved (I'm working on that one right now)

             

            S.

            • 3. Re: Adding "resource-adapter" using CLI
              rareddy

              I am trying to use CLI feature to automatically generate the resource adapter configurations in Teiid. Once the script is done, the "process-state" says "reload-requied". Can somebody explain what "reload-requires" means? restart of the server?

               

              Using Teiid Designer, we connect to live AS server and create ad-hoc data sources and resource-adapters and issue queries against them. If user has to stop and start server each time, huge inconvenience and time killer. Why do one need to restart the server for creating resource-adapter?

               

              Thanks.

               

              Ramesh..

              • 4. Re: Adding "resource-adapter" using CLI
                jesper.pedersen

                Watch AS7-3249

                • 5. Re: Adding "resource-adapter" using CLI
                  rareddy

                  Thank you, Jesper.

                   

                  Also while trying to create XA data source using CLI

                   

                  /subsystem=datasources/xa-data-source=PartsSourceC:add(jndi-name=java:/PartsSourceC,  driver-name=ojdbc6.jar, xa-datasource-class=oracle.jdbc.xa.client.OracleXADataSource, user-name=partssupplier, password=mm)
                  /subsystem=datasources/xa-data-source=PartsSourceC/xa-datasource-properties=URL:add(value=jdbc:oracle:thin:@{host}:1521:orcl)
                  /subsystem=datasources/xa-data-source=PartsSourceC:enable
                  

                   

                  This showed

                  {
                      "outcome" => "success",
                      "response-headers" => {"process-state" => "reload-required"}
                  }
                  

                   

                  However it seems like just message is wrong, I did see the data source created without reload. If you want me to log JIRA let me know.

                   

                  PS: I *like* that in CR1 version, there are no more "add" datasource/queue duplicate convenience methods. Less confusion, once you know how to use the CLI.