Four Stars

Oracle Rollback on Error

Hello Everyone!

 

I am, fairly, new to Talend, and I was wondering about how can I rollback in case of an error in case if the "Action on table" is not "NONE".  Your help is really appreciated.

 

Thanks!

7 REPLIES
Seven Stars sgv
Seven Stars

Re: Oracle Rollback on Error

Hello you can use :

- tOracleConnection (don't forget to uncheck commit automatique in advanced setting)

- tOracleCommit

- tOracleRollBack

- tOracleClose (don't forget to close you connection after your job)

 

Then you can manage your rollback and commit as you want and you have only one connection for your job. Instead of connect and disconnect for each tOracleInput or tOracleoutput

You can manage like this for example :

 

tOracleOutput --- OnComponentError --- tOracleRollback

     I

     I   _   _   _   _ OnComponentOk --- tOracleCommit

 

 

Hope this help.

 

Good luck ,

SGV

Four Stars

Re: Oracle Rollback on Error

Thanks for your reply. I have done this and I see that it goes to the rollback path however it doesnt do the rollback. And I was looking around in my destination the "action on table" is "drop table if exists" and I see warning saying that this will do an auto commit. Can you pleass explain to me what am I doing incorrectly?

Thanks
Seven Stars sgv
Seven Stars

Re: Oracle Rollback on Error

Please be sure that the "Use existing Connection" is checked on your tOracleOutput component.

 

Good Luck ,

SGV

Four Stars

Re: Oracle Rollback on Error

I made sure. The same thing exists
Seven Stars sgv
Seven Stars

Re: Oracle Rollback on Error

Oh ok, if you want to enable the "auto commit" you have to use the Default action on your tOracleOutput.

But if you want to trun table before insert, there is different way : 

- You can use a tOracleRow to execute a code before your tOracleOuput.

- You can use a temporary table

 

If you have some problem, send a screenshot of your job and explain the purpose of the job you have to do.

 

Good luck,

SGV



Six Stars

Re: Oracle Rollback on Error

Hello

 

do you want to drop the table or want to rollback the data on error?

 

"drop table if exists"--- this will drop your table from the database.

 

Thanks!

 

Four Stars

Re: Oracle Rollback on Error

I would like to drop the table if exists if the job succeeds only, otherwise I'd like for it to roll back.