-
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
Caching SQLServerBulkCopy object for batch insert #2435
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2435 +/- ##
============================================
+ Coverage 50.13% 50.77% +0.64%
- Complexity 3842 3880 +38
============================================
Files 145 145
Lines 33409 33421 +12
Branches 5667 5676 +9
============================================
+ Hits 16750 16970 +220
+ Misses 14258 14006 -252
- Partials 2401 2445 +44 ☔ View full report in Codecov by Sentry. |
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Outdated
Show resolved
Hide resolved
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.
add test
If bulkcopy is used for batch insert, and if multiple
executeBatch()
calls are made against the same prepared statement, then multiple SQLServerBulkCopy objects are instantiated which will cause repeated calls toselect * sys.columns...
. This PR caches the SQLServerBulkCopy object.