How to close a database connection created by a tMysqlConnection component

author
Shicong Hong
EnrichVersion
6.4
6.3
6.2
6.1
6.0
EnrichProdName
Talend Big Data Platform
Talend Big Data
Talend Data Integration
Talend Data Services Platform
Talend ESB
Talend Open Studio for Data Integration
Talend Data Fabric
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
Talend MDM Platform
Talend Data Management Platform
Talend Open Studio for Big Data
task
Design and Development > Designing Jobs
Data Governance > Third-party systems > Database components > MySQL components
Data Quality and Preparation > Third-party systems > Database components > MySQL components
Design and Development > Third-party systems > Database components > MySQL components
EnrichPlatform
Talend Studio

How to close a database connection created by a tMysqlConnection component

The tMysqlConnection is used to create a MySQL connection that will be used by other MySQL components, such as tMysqlnput or tMysqlOutput. In a Job, the tMysqlConnection does not close the connection and should be used with:
  • tMysqlCommit/tMysqlRollback components
  • a tMysqlClose component

tMysqlCommit/tMysqlRollback

You can use the option Close Connection in the tMysqlCommit/tMysqlRollback components to close the connection.

The tMysqlConnection component creates a connection, the tMysqlCommit commits the changes if the subjob works fine and closes the connection, while the tMysqlRollback rolls back the changes if the subjob fails and closes the connection.

tMysqlClose

You can use the tMysqlClose to close a MySQL connection if there is no tMysqlCommit/tMysqlRollback in the Job or if the Close Connection check box is not selected in the tMyslqCommit/tMysqlRollback.

For an example on using the tMysqlClose component, see Scenario: Reading data from databases through context-based dynamic connections.