Re-introduce Retry logic for prepared statement caching #618
Re-introduce Retry logic for prepared statement caching #618cheenamalhotra merged 13 commits intomicrosoft:devfrom
Conversation
…t caching to false
Codecov Report
@@ Coverage Diff @@
## dev #618 +/- ##
============================================
- Coverage 46.58% 46.44% -0.14%
+ Complexity 2229 2220 -9
============================================
Files 109 109
Lines 25409 25408 -1
Branches 4184 4186 +2
============================================
- Hits 11836 11801 -35
- Misses 11539 11569 +30
- Partials 2034 2038 +4
Continue to review full report at Codecov.
|
| } | ||
| catch (SQLException e) { | ||
| if (retryBasedOnFailedReuseOfCachedHandle(e, attempt)) | ||
| if (retryBasedOnFailedReuseOfCachedHandle(e, attempt) && connection.isStatementPoolingEnabled()) |
There was a problem hiding this comment.
Suggest changing retryBasedOnFailedReuseOfCachedHandle to take care of the connection.IsStatementPoolingEnabled() checking, that is part of whether or not to reuse.
| @@ -565,13 +566,18 @@ else if (EXECUTE_UPDATE == executeMethod && null != resultSet) { | |||
|
|
|||
| /** Should the execution be retried because the re-used cached handle could not be re-used due to server side state changes? */ | |||
| private boolean retryBasedOnFailedReuseOfCachedHandle(SQLException e, | |||
There was a problem hiding this comment.
Posting here as well as the method changed. Suggest changing retryBasedOnFailedReuseOfCachedHandle to take care of the connection.IsStatementPoolingEnabled() check which is part of whether or not to reuse.
TobiasSQL
left a comment
There was a problem hiding this comment.
Are there any tests of the actual retry logic?
Fixes issue #610