12

I want to perform transactions while writing into DB in Talend, but don't know how. I tried various component from palette, but couldn't manage to perform. I would appreciate any help or even better any tutorial related to this topic.

Thanks!

user696847
  • 469
  • 2
  • 7
  • 16

2 Answers2

14

Talend supports the transaction rollback and commit while writing into DB.

Let's take Mysql for example: to use tMysqlConnection to create a DB connection at the beginning of job and use a tMysqlCommit to commit the change and close if the previous subjob works fine, tMysqlRollback to rollback the change if the previous subjob work failure, the simple job looks like:

tMysqlConnection_1
    |
onsubjobok
    |
tFileInputDelimited--main---tMysqlOutput
    |
onsubjobok---tMysqlCommit
onsubjoberror---tMysqlRollback

on tMysqlOutput, check the option using an existing connection

competent_tech
  • 44,465
  • 11
  • 90
  • 113
Shong
  • 141
  • 3
2

There are various methods of writing data into a DB in Talend. You have the option of using a separate connection component (use an existing connection) or using a Built-In. When you use a separate connection component you need to explicitly commit your transaction using a tMSSqlCommit component (or similar component for another database type) . If you use a built-in then the transaction auto commits without a tMSSqlCommit component (or similar component for another database type).

I have prepared a more detailed tutorial for you but need reputation points to post images. I will try and get them to file server so I can link to them and post the more detailed answer.

E LaRoche
  • 1,106
  • 1
  • 7
  • 8