Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mr_burns
Contributor
Contributor

Question on MySQL database and commit

I have a tDBOutput component configured for a connection to a MySQL database:

0695b00000bECOfAAO.png  

In the component tab of tDBOutput under 'Advanced settings' I have an option called 'Commit every' which by default is set to 10000:

0695b00000bECOBAA4.png 

So far no problem. Now I want to use an existing database conection and activated 'Use an existing connection':

0695b00000bECP4AAO.png 

If I now look inside the 'Advanced settings' section the 'Commit every' disappeared:

0695b00000bECPnAAO.png 

I want to set the No. of lines when a commit should happen.

I looked every properties of the tDBConnection as well but there I also cannot find 'Commit every'.

Then I added a tDBCommit component but also here no property called 'Commit every' :-(.

Where please can I set the 'Commit every' now?

Labels (3)
1 Solution

Accepted Solutions
jlolling
Creator III
Creator III

Yes, this is because Talend has decided to do so. It would be possible to have this option also while using a separate connection. The problem they try to prevent is, the connection can be used in various components and you have to look into every component if you have a commit where it should not be the case.

Thats why the insisted in using separate tDBCommit components when using tDBConnection.

It would be the best you try to load everything on one transaction of if needed connect a tJavaRow after the tDBConnection and count here the records and connect the with an Iterate a tJava and from here connect the tDBCommit with an if trigger.

View solution in original post

3 Replies
jlolling
Creator III
Creator III

Yes, this is because Talend has decided to do so. It would be possible to have this option also while using a separate connection. The problem they try to prevent is, the connection can be used in various components and you have to look into every component if you have a commit where it should not be the case.

Thats why the insisted in using separate tDBCommit components when using tDBConnection.

It would be the best you try to load everything on one transaction of if needed connect a tJavaRow after the tDBConnection and count here the records and connect the with an Iterate a tJava and from here connect the tDBCommit with an if trigger.

Anonymous
Not applicable

Hello,

If your are using tMySqlConnection, your are supposed to add tMySqlCommit / tMySql Rollback components to handle yourself your transactions.

Adding a main row after your tMySqlOutput to a tMySqlConnection will commit row by row.

Hope this Mysql related topic helps.

https://help.talend.com/r/en-US/8.0/mysql/closing-a-database-connection-created-by-a-tmysql-connecti...

Best regards

Sabrina

mr_burns
Contributor
Contributor
Author

@jkolling, @xdshi,

 

OK thanks!