3 Replies Latest reply on Mar 6, 2014 1:57 PM by rareddy

    Teiid 8.4 -- org.teiid.adminapi.Admin.deleteDataSource(  )

    jane_lj

      Hi,

       

      We try to delete the following section from standalonexxx.xml for unregister:

       

      <resource-adapter id="test.rar">

                          <archive>

                              test.rar

                          </archive>

                          <transaction-support>NoTransaction</transaction-support>

                          <connection-definitions>

                              <connection-definition class-name="xxx" jndi-name="java:/xxx" enabled="true" pool-name="xxx">

                                  <config-property name="port">

                                      9910

                                  </config-property>

                                  <config-property name="importBatchSize">

                                      3000

                                  </config-property>

                                  <config-property name="hostName">

                                      host123

                                  </config-property>

                              </connection-definition>

                          </connection-definitions>

      </resource-adapter>

       

      We tried this method Admin.deleteDataSource(String deployedName), but only the section of <connection-definition> is deleted.

       

      How can we delete the whole section of <resource-adapter>?

       

       

      Thanks a lot!

        • 1. Re: Teiid 8.4 -- org.teiid.adminapi.Admin.deleteDataSource(  )
          rareddy

          Teiid does not provide deleting resource-adapters. Teiid controls the "connection" portion of the resources. Deleting the whole resource-adapter is akin to deleting a JDBC driver in the case of datasources. You can easily do this using CLI. You it is possible to add extensions to the admin api to do also.

           

          Ramesh..

          • 2. Re: Teiid 8.4 -- org.teiid.adminapi.Admin.deleteDataSource(  )
            jane_lj

            Thank you, Ramesh.

             

            Ok, so we think in another way.

             

            To reuse that resource-adapter, which API should we use to create connection portion, but not re-create the same resource-adapter?

            We tried Admin.createDataSource( ), it always complains the data source already exists. So looks like we need to use a different API to create connection portion only.

             

            Thanks.

            • 3. Re: Teiid 8.4 -- org.teiid.adminapi.Admin.deleteDataSource(  )
              rareddy

              There is no API function to add "resource-adapter", just like there is no API function to define a jdbc driver. You can deploy a JDBC driver or you can deploy a resource-adapter (.rar) file using "deploy", and use the names of the files as the module names for creating the data sources on top of it.

               

              But, there is bug in the JBoss AS7, that only allows one connection per .rar file, to workaround it, we manually defined "resource-adapter" definitions in the configurations and add data sources on it using the API multiple times.

               

              Ramesh..