How to use shared Data Sources with DB components in Jobs with tRouteInput

author
Talend Documentation Team
EnrichVersion
6.4
6.3
6.2
6.1
6.0
EnrichProdName
Talend Real-Time Big Data Platform
Talend Open Studio for ESB
Talend Data Services Platform
Talend MDM Platform
Talend ESB
Talend Data Fabric
task
Data Quality and Preparation > Third-party systems > Route components
Design and Development > Third-party systems > Route components
Data Governance > Third-party systems > Route components
EnrichPlatform
Talend Studio

How to use shared Data Sources with DB components in Jobs with tRouteInput

This article describes the usage of Data Sources with DB components in Jobs containing tRouteInput, which can be started only from a Route using the cTalendJob component.
Environment

This articles applies to Talend solutions with ESB .

Procedure

The following procedure shows how to use shared Data Sources with the tJDBC* components as an example. The same rules are valid for all DB components that support Data Sources.

1. Use the tPrejob to initialize the DB connection with tJDBCConnection.

Configure the tJDBCConnection for the Data Source by specifying the Data Source alias created on the Talend Runtime side.

2. Use the tPostjob to close the Data Source connection with tJDBCClose.

This is not valid for Data Service operation Jobs that contain the tESBProvider* or tRestRequest component. In these kind of Jobs it’s not recommended to use the close connection components like tJDBCClose, because closing Data Source connection is implemented in the tESBProvider* ortRestRequest component directly .

3. In the main part of the Job use commit or rollback components to control the transaction to the connected DB.

4. Use the existing connection configuration for all DB components in the Job.

tJDBCRow:

tJDBCCommit:

tJDBCClose:

The transaction to the connected DB is established.