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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Design a Job to Reconnect to and Re-run a Talend Job after a DB connection Failure

Hi,

 

I am using Talend Open Studio. I am trying to design a job to reconnect and re-run when a job failed due to DB connection failure. After the failure, let the job to sleep for 20 seconds after each iteration. I would like the job to retry to connect again and again(for a fixed number of times) until there is a successful connection.

I tried the following steps:

Parent job flow : tLoop -----> tRunJob -----> tJavaRow

 

tLoop code (use while loop) : context.status (status is a boolean context variable with default value as true

tJavaRow : 

                      if(row1.errorCode==0){
                      context.status=false;
                     }else if(row1.errorCode==1&&
                    ((Integer)globalMap.get("tLoop_1_CURRENT_ITERATION"))<15){
                    context.status=true;
                    Thread.sleep(5*1000);
                    }else{
                    context.status=false;

 

This is not working for me. Please help me to design a job to retry after a failure.

Labels (3)
10 Replies
Anonymous
Not applicable
Author

This is not possible while a job is running. When you run a job it is essentially a compiled Java application. Editing your connection details while a job is running will not make a difference. You could engineer this to work  by building logic which is compiled into the job, to provide bad connection details for the first couple of iterations and the correct info for the 3rd iteration (for example).