DB Connection Re-try

DB Connection Re-try

Hi,

I have a requirement where I have to re-try DB Connection for 5 times untill it connects. A flow like this:
start->Db Connect-> if connection succeeds->go to next component
                         ->if connection fails->sleep for 5 seconds->re-try for 5 more times->if connection succeeds-> go to next component
                                                                                                                  ->if connection fails -> die

Please help.

Moderator

Re: DB Connection Re-try

Hi,
Could you please take a look at this scenario:TalendHelpCenterSmiley Frustratedcenario: Job execution in a loop to see if it is satisfying your needs?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: DB Connection Re-try

You need to establish a loop, try your connection. determine if it was successful. break loop on success. sleep and retry on failure. break loop when you've tried x (5) times.
Test for success and failure after loop.

You may be able to use OnSubjobOk and OnSubjobError to determine success or failure.

If these connectors do not cut it, you can also set-up your own Exception Handler, using tJavaFlex. Sometimes you want to know a little more able why it's failed. There's no point in retrying if your password is wrong, as you may simply lockout the account and have more headaches to sort out.

http://www.talendbyexample.com/talend-tjavaflex-component-reference.html

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog