Five Stars

Roolback and Commit

I am trying to create a Rollback and Commit Job in Talend as shown below. On encountering an error, the flow shows to be going to the Rollback component, but the question is what has been rolled back? I can still see in my DB the 6 records as is shown in the figure. How to achieve commit and rollback then in Talend?

 

Regards

Pankajcommit2.jpg

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Roolback and Commit

Hi ppp_rrr
This is a new question about data validations, please open a new topic for a new question. One topic for one question helps us to manage the questions and other users to find answer/solution easily.
Thanks!
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
15 REPLIES
Seven Stars

Re: Roolback and Commit

does your tOracleConnection component have auto-commit option checked?

If yes, try disabling it and run again. In such a case, I don't really think a separate rollback component is required since the data gets committed only if the sub job loading to oracle table, gets completed successfully.

Five Stars

Re: Roolback and Commit

No it is unchecked.

Also the sub job loading to oracle table is OK as you can see in the screen.

the real question is when the error has happened and the flow goes to Rollback, why not actual Rollback took place?

Seven Stars

Re: Roolback and Commit

Well, in that case you shouldn't see those 6 records in the table as the flow would never reach tOracleCommit Component.

This is weird. Maybe you can try using tLogCatcher instead of the 'onSubJobError' link and see if that works.

Five Stars

Re: Roolback and Commit

Ya this is what the problem is... I am not getting proper help or guidance to proceed..

I wonder what should i do?

Nine Stars

Re: Roolback and Commit

Please verify that your TESTOUTPUT component is using the same connection as the commit and rollback components.
Seven Stars

Re: Roolback and Commit


ppp_rrr wrote:

Ya this is what the problem is... I am not getting proper help or guidance to proceed..

I wonder what should i do?


I am just thinking out loud here but can you try using a tOracleRow component to write a rollback query and see if that works.

Five Stars

Re: Roolback and Commit

Ya confirmed, the TESTOUTPUT component is using the same connection as the commit and rollback components.

Community Manager

Re: Roolback and Commit

Hello
Make sure the 'die on error' option is checked on tOracleOutput, so that the job will die and throws the Java exception if there occurs an error during the job execution.
I have made a testing on version 6.4.0 and it works as expected. Which version are you using? What's the error messages thrown on the console?

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: Roolback and Commit

Hello Shong,

Did exactly as you said. checked the 'die on error' option, but still can't see the Rollback in effect. See the screenshot below again, there is an exception in 7th row shown in the console as well, and the flow goes to Rollback component. But, records can be seen in DB.

I am using Talend 6.3 for Data Integration.

rollback_error.jpg

Six Stars

Re: Roolback and Commit

Could you add a screenshot of your TESTOUTPUT component configuration?

Five Stars

Re: Roolback and Commit

OK here it is.output_1.jpgoutput_2.jpg

Six Stars

Re: Roolback and Commit

You are using the connection settings from the repository, but you should set the "Use an existing connection" checkbox to use the transaction.

 

Community Manager

Re: Roolback and Commit

OMG, you said you use the same connection, I thought you have checked the 'Use an existing connection' checkbox.
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: Roolback and Commit

O ya..just got confused for the 'same connection' as both the Connection component and Output component had same connection properties from Repository.

So, thanks that first part has been resolved.

Now, the actual scenario is that my client wants that if we put some auto fix validations like name.replaceall() etc. in some data transformation step, then he should be able to visually see all data errors that were fixed automatically so that he can approve and/or reject and/or rollback.

Will this be possible to achieve?

Community Manager

Re: Roolback and Commit

Hi ppp_rrr
This is a new question about data validations, please open a new topic for a new question. One topic for one question helps us to manage the questions and other users to find answer/solution easily.
Thanks!
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business