AZ-204 · Question #94
You develop and deploy an ASP.NET Core application that connects to an Azure Database for MySQL instance. Connections to the database appear to drop intermittently and the application code does not ha
The correct answer is A. Increase connection repeat attempts exponentially up to 120 seconds. C. Wait five seconds before repeating the connection attempt to the database. E. Set a maximum number of connection attempts to 10 and report an error on subsequent connections.. The first and second case are fairly straight forward to handle. Try to open the connection again. When you succeed, the transient error has been mitigated by the system. You can use your Azure Database for MySQL again. We recommend having waits before retrying the connection. Ba
Question
Options
- AIncrease connection repeat attempts exponentially up to 120 seconds.
- BClose the database connection and immediately report an error.
- CWait five seconds before repeating the connection attempt to the database.
- DDisable connection pooling and configure a second Azure Database for MySQL instance.
- ESet a maximum number of connection attempts to 10 and report an error on subsequent connections.
How the community answered
(31 responses)- A84% (26)
- B6% (2)
- D10% (3)
Explanation
The first and second case are fairly straight forward to handle. Try to open the connection again. When you succeed, the transient error has been mitigated by the system. You can use your Azure Database for MySQL again. We recommend having waits before retrying the connection. Back off if the initial retries fail. This way the system can use all resources available to overcome the error situation. A good pattern to follow is: - Wait for 5 seconds before your first retry. - For each following retry, the increase the wait exponentially, up to 60 seconds. - Set a max number of retries at which point your application considers the operation failed. https://docs.microsoft.com/en-us/azure/mysql/single-server/concepts-connectivity
Topics
Community Discussion
No community discussion yet for this question.