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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.21%. Comparing base (08cd6fd) to head (6779332).
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.22%   51.21%   -0.01%     
- Complexity     3953     3960       +7     
============================================
  Files           147      147              
  Lines         33657    33661       +4     
  Branches       5624     5625       +1     
============================================
  Hits          17241    17241              
- Misses        13999    14004       +5     
+ Partials       2417     2416       -1     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

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