[resolved] DB Connection close

One Star

[resolved] DB Connection close

hello all,
Im using talend Version 5.2.2. In jobs im using tMysqlConnection Component. I read in manual to close connection we have to use tMysqlClose Component.

So my doudt is :
1) how i will get to know connection is closed?? how can i check that connection is closed or not.
2) in job i used follwing flow to close the connection.
tpostjob--OnComponent ok --- > tMysqlClose. so is this proper way to close connection ??
Please suggest Answer for these two questions.
Thanks and Regards,
Akshath Hegde

Accepted Solutions
Community Manager

Re: [resolved] DB Connection close

Yes,
You can use tpostJob--tMysqlClose to make sure the DB connection is always closed at the end of job, but note that the DB connection has not been closed yet on other component such as tMysqlCommit, tMySQLRollback, otherwise, you will get NPE error.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post


All Replies
Community Manager

Re: [resolved] DB Connection close

Do you use a tMysqlConnection in the job to create the DB connection or create the DB connection on input/output component such as tMysqlInput? If the former, you have to use a tMysqlClose to close the DB connection at the end of job, if the later, the DB connection is closed on the input/output component.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] DB Connection close

hi shong,
Thank you for response. Im using tmysqlConnection component for connection.
Can i close connection like this " tpostjob ---> tmysqlclose" ?? if i use tpostJob, whether it will be a problem??
Regards,
Akshath
Community Manager

Re: [resolved] DB Connection close

Yes,
You can use tpostJob--tMysqlClose to make sure the DB connection is always closed at the end of job, but note that the DB connection has not been closed yet on other component such as tMysqlCommit, tMySQLRollback, otherwise, you will get NPE error.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog