• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Oracle rollback in a child job

#1 2010-07-23 13:10:48

TomasAlmeida
Member
Registered: 2010-06-15
Posts: 22

[resolved] Oracle rollback in a child job

Hi All,

I read from an Excel File and send the data to a subjob, in this subjob I try to put this data in two different tables. If this fails, I need to rollback all the insertions. But, I would like to continue reading from the excel file and processing the others lines:

My jobs are

Father:
tOracleConnection ---> ExcelFile ---> tRunJob  --- onComponentOk --->tOracleCommit
                                                                       --- onComponentError ->tOracleRollback

Child:
tOracleConnection ---> tMap ---> tOracleOutput
                                            ---> tOracleOutput


tOracleOutput and tRunJobs have checked the "die on Error" and "die on childError"

Any ideas?

thanks for advance

Offline

#2 2010-07-23 15:32:56

shong
Talend team
Registered: 2007-08-29
Posts: 10310
Website

Re: [resolved] Oracle rollback in a child job

Hi
The job looks like:
Father:
tOracleConnection_1 
   |
onsubjobok
    |
tFileInputExcel ---tFlowToIterated---iterate--> tRunJob
    |
onsubjobok
    |
tOracleCommit(finally, close the connection)

on tOracleConnection_1, check the box 'use or register a shared DB connection and type in a connection name.
on tRunJob, uncheck the box 'die on child job error', pass each row to child job via context variable(see [Forum, topic 1654] Passing context parameters in a tRunJob)

Child:
tOracleConnection_1
    |
onsubjobok
    |
tFixedFlowInput ---> tMap ---> tOracleOutput
                                       ---> tOracleOutput
    |
onsubjobok-->tOracleCommit(don't close the connection)
onsubjoberror-->tOracleRollback

on tOracleConnection_1, check the box 'use or register a shared DB connection and type in the connection name defined in the father job.

on tFixedFlowInput, generate each row passed from father job.

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2010-07-26 10:35:24

TomasAlmeida
Member
Registered: 2010-06-15
Posts: 22

Re: [resolved] Oracle rollback in a child job

Thanks Shong for your help, it works!

But I would like to send the error for the father and log it, is that possible? I tried to use a tBufferOutput, but I do not know how to recover the error, because it can happen in two points (the two tOracleOutput's). Could you (or other nice guy big_smile) help me on that?

Thanks in advance

Tomás

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Oracle rollback in a child job

Board footer

Powered by FluxBB