-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-introduce Retry logic for prepared statement caching #618
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.
|
@@ -547,7 +547,7 @@ final void doExecutePreparedStatement(PrepStmtExecCmd command) throws SQLServerE | |||
getNextResult(); | |||
} | |||
catch (SQLException e) { | |||
if (retryBasedOnFailedReuseOfCachedHandle(e, attempt)) | |||
if (retryBasedOnFailedReuseOfCachedHandle(e, attempt) && connection.isStatementPoolingEnabled()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest changing retryBasedOnFailedReuseOfCachedHandle
to take care of the connection.IsStatementPoolingEnabled()
checking, that is part of whether or not to reuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any tests of the actual retry logic?
Fixes issue #610