[resolved] Rolling Back data of all subjobs in case of error

One Star

[resolved] Rolling Back data of all subjobs in case of error

Hi 

I have the following case:

I have 2 separate subjobs within a job that push data into to separate tables with master/child relationship. Upon executing the Job the master SubJob succeeds and imports the data in the master table and when I got an error in the execution of the Child Subjob the whole Job halts with an error but the imported data in the master SubJob has already been committed which is creating inconsistency in may database model. I need a help in considering all data in subjobs as one unit either all of them committed  in case of successful execution or rolleback in case of error. Is there a way of doing it noting that I'm using  tOracleOutput components to push the data to the destination tables and tDie components to halt the system in case of error.

Thanx


Accepted Solutions
One Star

Re: [resolved] Rolling Back data of all subjobs in case of error

Thanx Kzone.

Actually I used the tOracleConnection, tOracleCommit and tOracleRollback and it worked.

Regards,

View solution in original post


All Replies
Seventeen Stars

Re: [resolved] Rolling Back data of all subjobs in case of error

hi wissamaoufan,

consider that if you want to start a transaction you need to use tConnectionXXX & tClose (connection) component.
Every output DB components that 'll use that transaction, will use the option 'use an existing connection'.
By that way, you'll have to commit/rollback your transaction depending on success/error of your application.

If the transaction occured on several job or master/child job , you should name your connection (instance's name).
Every job that need to use that instance for transaction will need to use the tconnectionXXX component and the selection of that option.
Hope I'm clear enought as it sound  a little bit tricky Smiley Happy

see that page on Talend Help portail & I think you'll got it Smiley Wink
https://help.talend.com/search/all?query=Sharing+database+connection+between+parent+job+and+child+jo...

hope it helps
regards
laurent
One Star

Re: [resolved] Rolling Back data of all subjobs in case of error

Thanx Kzone.

Actually I used the tOracleConnection, tOracleCommit and tOracleRollback and it worked.

Regards,

View solution in original post

Seventeen Stars

Re: [resolved] Rolling Back data of all subjobs in case of error

great Smiley Happy
thanks to put topic as resolved
regards

2019 GARTNER 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

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog