Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
brolio
Contributor II
Contributor II

How to make a database transaction across multiple subjobs

The title says it all,

I have a job that for the moment is divide into multiple sub-jobs. Each sub-job does almost the same task which is just fetching data from one DB table and back it up in another database table with the same data structure. 

The problem I'm facing is that for some reason if one of the jobs fails, the records belonging to this job will be not persisted but all the remaining jobs will do just fine.

So in the end I end up with problems of data consistency and integrity.

I need that all sub-jobs work as a single TRANSACTION, either everything goes well or nothing at all.

Thank you for your time!

Labels (3)
2 Replies
vikramk
Creator II
Creator II

Hi brolio,

At the end of each subjob, you could use "onsubjoberror" option and do write some query to rollback the changes made on subjob1,

Similarly at the end of 2nd subjob, you should have to write rollback query for changes made in both 1st and 2nd subjob likewise you have to implement for all the subjobs.

 

Let me know if it helps

brolio
Contributor II
Contributor II
Author

Hi @vikramk

Thank you for your reply. You ideia make sense but I really was expecting that talend had a way to deal with this kind of situation much more smoothly. I mean this is an everyday situation.

 

But again mate, thank you very much for your time!