Skip to content

Changed the scope of BULK_COPY_OPERATION_CACHE to connection.#2594

Merged
machavan merged 2 commits intomainfrom
dev/machavan/issue2585
Feb 26, 2025
Merged

Changed the scope of BULK_COPY_OPERATION_CACHE to connection.#2594
machavan merged 2 commits intomainfrom
dev/machavan/issue2585

Conversation

@machavan
Copy link
Copy Markdown
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.

@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

ADO tests are good for this PR

@machavan machavan merged commit 7e795d4 into main Feb 26, 2025
@github-project-automation github-project-automation Bot moved this from Under Peer Review to Closed/Merged PRs in MSSQL JDBC Feb 26, 2025
@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