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

Changed the scope of BULK_COPY_OPERATION_CACHE to connection. #2594

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

machavan
Copy link
Contributor

@machavan machavan commented Jan 28, 2025

Description:

The BULK_COPY_OPERATION_CACHE should be defined at connection scope and not global scope to avoid incorrect cache hits across connections and potential OOM issues.

Testing:

  • Updated existing unit tests for this functionality accordingly.
  • Existing unit tests as part of build pass with the change.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 51.50%. Comparing base (c01814b) to head (4e78875).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2594      +/-   ##
============================================
+ Coverage     51.49%   51.50%   +0.01%     
+ Complexity     3993     3992       -1     
============================================
  Files           147      147              
  Lines         33690    33694       +4     
  Branches       5629     5630       +1     
============================================
+ Hits          17348    17355       +7     
+ Misses        13902    13882      -20     
- Partials       2440     2457      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mmimica
Copy link
Contributor

mmimica commented Jan 29, 2025

More importantly, it solves a problem when a driver instance is used to connect to different SQLServers. Tables from different databases could end up in the same static cache.

@Jeffery-Wasty Jeffery-Wasty added this to the 12.10.0 milestone Feb 11, 2025
@machavan
Copy link
Contributor Author

ADO tests are good for this PR

@machavan machavan merged commit 7e795d4 into main Feb 26, 2025
19 checks passed
@Jeffery-Wasty Jeffery-Wasty deleted the dev/machavan/issue2585 branch March 4, 2025 20:36
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.

Bulk copy metadata should not be cached for temporary tables
6 participants