An ASP.NET Core app connects to Azure Database for MySQL, but connections fail intermittently and the code doesn't handle transient failures. Which three approaches can you use in code to implement retry handling for transient connection errors? (Each correct answer is part of the solution.)
Choose an answer
Tap an option to check your answer.
Correct answer: Wait five seconds before repeating the connection attempt to the database., Set a maximum number of connection attempts to 10 and report an error on subsequent connections., Increase connection repeat attempts exponentially up to 120 seconds..
Why this is the answer
Implementing retry logic for transient errors requires a strategy that includes delays, limits, and increasing backoff. Waiting a fixed amount of time, like five seconds, before retrying is a basic form of delay that allows the transient condition to resolve. Setting a maximum number of connection attempts, such as 10, prevents infinite loops and ensures the application eventually fails gracefully if the problem persists. Exponential backoff, where the delay between retries increases with each attempt (e.g., up to 120 seconds), is crucial because it avoids overwhelming the database with immediate retries and gives it more time to recover. Closing the connection and immediately reporting an error doesn't implement retry logic. Disabling connection pooling and configuring a second instance are architectural changes, not code-based retry handling for transient errors.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed