Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5939

connection pool not destroyed after datasource deletion without server reload(java)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 14.0
    • 11.1.2
    • AdminApi
    • None
    • DV Sprint 63
    • 0.5

      Hi Team,

      Connection pool is not removed after deletion of datasource using java code.
      Teiid(Jboss) server reload required to reflect the deletion of connection pool from actual database(we are using mysql as database).
      Until server reloads, connections in deleted datasource's connection pool remain in sleep mode.

      Pre-requisite

      • Connection is created with the mysql database using teiid
      • Datasource is created in teiid.
      • Delete the above created connection through java using code i.e by using AdminApiClientAccessor.
      • That removed the datasource from teiid.
      • Through below code I am able to delete the datasource.

      Java code

      import org.teiid.adminapi.Admin;
      ..
      
      private Admin admin;                            //assigned object to admin;
      ..
      ..
      public void deleteDataSource(String datasourceName){	
      		try {
      			admin.deleteDataSource(datasourceName);
      		} catch (Exception e) {
      			logger.error(e);
      		}
      }
      

      datasourceName = name of the datasource created earlier.

      standalone-teiid.xml

      </xa-datasource>
      ..
      ..
      <xa-pool>
      <min-pool-size>3</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <flush-strategy>IdleConnections</flush-strategy>
      </xa-pool>
      <validation>
      <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
      <background-validation>true</background-validation>
      <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
      </validation>
      </xa-datasource>

      Issues :

      • Even though datasource removed, connection pool is not destroyed
      • Able to see connection threads available on Mysql admin console using the command
       show processlist;
      
      • Changes reflect only when the Teiid (jboss) server is reloaded.
      • Once server reloads connections in connection pool is closed/removed from the database.
      • 'Too many connection' issue facing on mysql server due to multiple connection threads remains in sleep mode even though datasource are already removed.

      Please let us know :

      • Is there any method to remove connection pool from actual database.
      • Is server reload mandatory.

              rhn-engineering-shawkins Steven Hawkins
              manojma Manoj Majumdar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 3 hours
                  3h
                  Remaining:
                  Time Spent - 2 hours Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - 2 hours Remaining Estimate - 1 hour
                  2h