Six Stars

How to use commit & rollbak Mysql

Hi, 

I have jobs which are connected to each other.

I am confused, where to put commit & rollback.

Scenario: All the jobs should complete or none. Kindly help

3 REPLIES
Fifteen Stars

Re: How to use commit & rollbak Mysql

Your screenshot shows one job. Before I can help I need to know what you meant by "job"? Did you mean multiple jobs considering the screenshot to be an example one job? Or did you mean multiple jobs considering the different subjobs (areas encapsulated in a blue box) in your screenshot?

Rilhia Solutions
Six Stars

Re: How to use commit & rollbak Mysql

Basically, If the first block succeed, means data from customer to customer moves without problem, then it should go to second block(lookup transfar) and commit as a whole unit. If second block fails then it should roolback the first block. Here I am not able to understand where to keep the rollback and commit components. You are correct , I am talking about the blue boxes Hope this clears the doubt.

Fifteen Stars

Re: How to use commit & rollbak Mysql

Take a look at this page: https://help.talend.com/reader/NNO~fmVQU4rlkF9Depfdxw/CInUFSCGXiagiSq0fcnFLQ?section=Raa91640

 

It shows how to use a tMySQLConnection and a tMySqlCommit. To do what you want you need to start with creating a connection, do each of your steps, then decide at the end (maybe using a tPostJob) whether everything has happened cleanly (then Commit) or whether you need to rollback (use the tMySQLRollback).

Rilhia Solutions