DeletionService - IFhirDataStore scoped handling #5363
Merged
Conversation
…nstaces of IScope.
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
...osoft.Health.Fhir.Core.UnitTests/Features/Persistence/DeletionServiceScopedDataStoreTests.cs
Fixed
Show fixed
Hide fixed
...osoft.Health.Fhir.Core.UnitTests/Features/Persistence/DeletionServiceScopedDataStoreTests.cs
Fixed
Show fixed
Hide fixed
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
LTA-Thinking
reviewed
Feb 2, 2026
src/Microsoft.Health.Fhir.Core/Features/Persistence/DeletionServiceScopedDataStore.cs
Show resolved
Hide resolved
LTA-Thinking
previously approved these changes
Feb 2, 2026
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
LTA-Thinking
approved these changes
Feb 3, 2026
fhibf
added a commit
that referenced
this pull request
Feb 5, 2026
* Changes to support FhirDataStore with different scopes in DeletionService. * Adding comments. * Revert changes in appsettings. * Adding hew IDeletionServiceDataStoreFactory. * Adding the concept of scopes to manage the deletion of already used instaces of IScope. * Adding new class to handle scenarios where data store should be disposed or not. * Adding new comment. * Improving Dispose logic. * New tests validation DeletionServiceScopedDataStore. * Fixing tests. * Fix PR suggestion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In this PR we're creating a new component to handle the creation of IFhirDataStore instances for the Deletion Service.
Cosmos DB requires new instances of the FHIR Data Store to ensure that long running operations (+1 hours) will always have fresh tokens.
While SQL Server operations always require only scoped instances of IFhirDataStore to handle transactions.
With the addition of IDeletionServiceDataStoreFactory, now both services can have different implementations without affecting one another.
SqlDeletionServiceDataStoreFactory implements IDeletionServiceDataStoreFactory, and creates instances of DeletionServiceScopedDataStore using scoped instances (.Scoped()) of IFhirDataStore.
CosmosDeletionServiceDataStoreFactory implements IDeletionServiceDataStoreFactory, and creates instances of DeletionServiceScopedDataStore using instances of IFhirDataStore using IScopeProvider.
Related issues
Addresses AB#182156.
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)