Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How does tOracleRollback behave? What does the rollback error message look like?

Dear all,

I have been using the tOraclexxx components for a while, and still don't understand how the tOracleRollback works.

 

Here is what I usually do:

 

tDBInput--->tMap--->tDBOutput
| |
OnSubjobOK OnSugjobError
| |
| Rollback
Commit

 

And I also do something after commit and rollback:

Commit   --OnComponentOK--> tWarn_1

Rollback --OnComponentOK--> tWarn_2

 

Here is what I put in the "Warn message" area:

tWarn_1:

String.format("%s: %s", context.uac_Schema+"."+ context.tgtTable,"Num of New jobs inserted = "+((Integer)globalMap.get("tDBOutput_2_NB_LINE_INSERTED"))+" & "+"Num of jobs updated = "+((Integer)globalMap.get("tDBOutput_1_NB_LINE_UPDATED")))

 

tWarn_2:

String.format("%s: %s", context.uac_Schema+"."+ context.tgtTable, "Rollback nessage: "+((String)globalMap.get("tDBRollback_1_ERROR_MESSAGE")))

 

The tWarn_1 is very nice: it prints out how many rows the job inserted/updated/deleted depending on the job designs. It is very useful during the testing/troubleshooting when job fails.

 

But I have never seen tWarn_2 print anything for me so far even though sometimes my job failed --

and my question: is the tWarn_2 unnecessary component here? Could anyone provide a simple example of using tOracleRollback and print out the rollback error message for me ( and others like me who may have the same confusion)?

 

Thanks!

 

 

 

Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi,

 

    Rollback components are used to make sure that entire data is rolled back in case the input data volume is high and your DB load failed in between.

 

    For example, you have 1 million records and data will be written to table at regular intervals since we will not be able to pump 1 million in a single batch. When the data load reached 50,000 records, you got some error data and job failed. Now, the initial 50k records are still in DB but ideally you need to roll these data back. tDBRollback helps in this context where it will rollback from all the associated tables (this table and any previous tables) which got loaded under same tDBConnection unless you have given an explicit commit.

 

    Could you please refer the link below for a quick sample scenario too?

 

https://help.talend.com/reader/jomWd_GKqAmTZviwG_oxHQ/7THiSA~u~mPb7PskcQONMQ

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved