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.
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.
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.