Skip to content
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

Merged
merged 4 commits into from
Jun 17, 2024
Merged

Caching SQLServerBulkCopy object for batch insert #2435

merged 4 commits into from
Jun 17, 2024

Conversation

tkyc
Copy link
Contributor

@tkyc tkyc commented May 28, 2024

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 to select * sys.columns.... This PR caches the SQLServerBulkCopy object.

Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 62.96296% with 20 lines in your changes missing coverage. Please review.

Project coverage is 50.77%. Comparing base (722c910) to head (edf02ce).
Report is 2 commits behind head on main.

Current head edf02ce differs from pull request most recent head 76479d5

Please upload reports for the commit 76479d5 to get more accurate results.

Files Patch % Lines
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 62.26% 11 Missing and 9 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@Jeffery-Wasty Jeffery-Wasty added this to the 12.7.1 milestone Jun 3, 2024
Jeffery-Wasty
Jeffery-Wasty previously approved these changes Jun 3, 2024
barryw-mssql
barryw-mssql previously approved these changes Jun 4, 2024
Copy link
Contributor

@lilgreenbird lilgreenbird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test

@tkyc tkyc merged commit aae94a6 into main Jun 17, 2024
15 checks passed
@tkyc tkyc deleted the bc-obj-caching branch June 17, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

4 participants