[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

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