Skip to content

Fix SqlUtils.WithRetry() to open a new connection if the last attempt closed the connection due to network issues.#221

Merged
cgillum merged 3 commits intomicrosoft:mainfrom
microrama:Fix216
Jun 3, 2024
Merged

Fix SqlUtils.WithRetry() to open a new connection if the last attempt closed the connection due to network issues.#221
cgillum merged 3 commits intomicrosoft:mainfrom
microrama:Fix216

Conversation

@microrama
Copy link
Copy Markdown
Contributor

Pass the DBCommand to the SqlUtils.WithRetry() method and let the method check the DBCommand connection state and open if needed before attempting the next attempt. This way, we avoid throwing an Error back when there is a intermittent network connectivity issue.

Copy link
Copy Markdown
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cgillum cgillum merged commit 5dbe623 into microsoft:main Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants