DB Connection Re-try

Highlighted

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

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog