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: 
Anonymous
Not applicable

Job retry mechanism in case of DB connection failure in Talend

Hi Guys,

I have a requirement in which I extract data from files and databases as source into target databases (mostly oracle).

But sometimes job fails because of some db connection errors like "Connection timed out" and "network adapter could not establish connection" like these. when such issues arise I would like the job to retry to connect again and again(for fixed number of times) until there is successful connection.

So can anyone help me on how can I achieve this instead of running the job manually when these errors occur?

 

Quick reply would be appreciated.

Thanks in advance.

Labels (2)
15 Replies
fdenis
Master
Master

if it's for 3 time, just add a parent jab calling 3 times your job link subjobs with on subjobError.
Anonymous
Not applicable
Author

Hi,

Sorry I didn't get you. Could you please elaborate if possible??

 

fdenis
Master
Master

open a new job
add tRunJob calling your job with oracle db connection ….
add an other trunjob calling your calling your job with oracle db connection ….
link first and second trunjob with an onSubjobError.
that's all.
Anonymous
Not applicable
Author

Hi,

PFA screenshot.

Is this the approach you are speaking about??

But I want the job to retry on its own for multiple times until the connection gets established.

Please correct me if i'm wrong on my requirement.


1.PNG
fdenis
Master
Master

I just say if it's for 3 times.
an other way is to make an infinit loop tloop with always false exit condition.
with a tDie on an onSubjodOk link.
Anonymous
Not applicable
Author

Hi ,

I have tried to implement the solution using tLoop

PFA screenshot.

 code in tLoop(while loop) :  i<=10 && context.status == false

I intentionally made the job to fail with connection error but still its making only 1 attempt instead of 10

which is defined in the loop.

tJava : im resetting the context.status = true if conn is fine.


2.PNG
fdenis
Master
Master

you have to link tloop with trunJob or to add a tlogCatcher to still run after the error.
Anonymous
Not applicable
Author

Yes I have tried connecting the tLoop to tRun job which has the main connection check.

but after that how to proceed?

 

PFA screenshot.

 

It would be great if you have any sample job designed so that it will be easy for me.


3.PNG
fdenis
Master
Master

set tLoop for 10 loop.
add the onSubjobOk to tDie.