-
Notifications
You must be signed in to change notification settings - Fork 435
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
Fix prepared statement metadata cache issue #543
Fix prepared statement metadata cache issue #543
Conversation
… fix for BatchTriggerTest
Codecov Report
@@ Coverage Diff @@
## dev #543 +/- ##
============================================
- Coverage 46.68% 46.51% -0.17%
+ Complexity 2228 2214 -14
============================================
Files 108 108
Lines 25308 25321 +13
Branches 4175 4175
============================================
- Hits 11815 11779 -36
- Misses 11463 11522 +59
+ Partials 2030 2020 -10
Continue to review full report at Codecov.
|
…ching is disabled on the connection
…otherwise throw sql server exception
This SQLServerConnection.contextChanged thing, do we really believe that we can keep this accurate? There are lots of reasons for the context on the server to change, trying to figure this out from the client side seems like a losing proposition. This was why we went with re-try logic instead, obviously with its own issues. What are the thoughts here? |
@TobiasSQL Thank you so much for checking the code. I did talk to our team about the limitation of this |
|
||
if (definitionChanged || connection.contextChanged) { | ||
prepStmtHandle = -1; // so that hasPreparedStatementHandle() also returns false | ||
return false; |
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.
we should also add these two in here, do you agree?
if (connection.contextChanged) {
connection.contextChanged = false; // to be able to use the handle after this call
connection.clearCachedPreparedStatementHandle(); //making sure the cache is cleared
}
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.
Thank you so much for the suggestion, it's much better.
@TobiasSQL Hello, the team has decided to merge this PR. Please feel free to leave comments after it's merged. |
also added tests to verify the number of insertion/update executed.