Project: talendesb
Issue TESB-6967: Support improved connection pooling for Data Services
h3. Summary: Database connections are shared across multiple data services deployed at runtime and managed by system administrator. h3. Process and roles view There are two roles involved in development and deployment of the Data Service: *Job Designer* and *System Administrator*. These are participating in the Data Service design, development and deployment process as following: * Job Designer has a business problem to solve., Job designer is able to create a job and test it against a (local) test database. Job Designer do not know location and system details of the target environment (DB host name, username, password) as well as she is not aware about technical constraints of databases (number of concurrent connections). Job Designer uses check a checkbox on database connection component to enable shared connection pooling in Runtime and give a pre-defined connection pool alias. After that Data Service is published on Talend Artifact Repository. * System Administrator may not be aware about specific business problem, she is however know all the environment details (database host, port, username and password) as well as configuration details (number of concurrent connections). System Administrator configure a system pool under pre-defined alias and specify all required information (host, port, username/password, maximum number of concurrent connections and other pool properties and DB-specific configuration options). After that System Administrator uses TAC to deploy Data Service form Talend Artifact Repository. h3. Technical structure h4. Components # Talend Database components are passing around a specially designed *TalendDataSource* object instead of *java.sql.Connection*. # Instances of *TalendDataSource* should be stored in *global map*. # *TalendDataSource* object is responsible for holding a pre-configured *java.sql.DataSource*. # *TalendDataSource* will also provide a *java.sql.Connection* instance to when database components needs it and store this instance internally. # *TalendDataSource* will have a *closeConnection* method that will call a *java.sql.Connection#close* if *java.sql.Connection* is stored in *TalendDataSource* # After *TalendDataSource#close* method will be called *TalendDataSource* would need to use internal *java.sql.DataSource* to fetch a new instance of *java.sql.Connection* as soon as it will be required. h4. ESB Team # ESB Team will take care that when ESB request/response loop will be completed (successfully or with exception) all *TalendDataSource* found in global map will get their *closeConnection* method called. h5. Runtime Team # Runtime team will take care that necessary infrastructure is available at runtime and documentation, describing how to configure data source, is available.
Story points: 3