Skip to content

Enlist transactions enabled only for Sequential Transactions#5611

Open
fhibf wants to merge 3 commits into
mainfrom
user/fhibf/enlistTransactionLimitedToSeqBundles
Open

Enlist transactions enabled only for Sequential Transactions#5611
fhibf wants to merge 3 commits into
mainfrom
user/fhibf/enlistTransactionLimitedToSeqBundles

Conversation

@fhibf

@fhibf fhibf commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

In this PR, I'm setting "enlistTransaction" to false for most all operations, except by Sequential Bundle Transactions.

During last week, it was noticed that deadlocks were not retried in standalone operations as they were set to enlist in transaction. By setting that to false, it'll now: (1) be included as part of SQL transaction in MergeResources; (2) retry deadlock errors if any.

With these changes we should make standalone operations more stable and resilient to sporadic deadlocks (considered as retriable).

Related issues

Addresses AB#195581.

Testing

  • Tested through local validations.

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@fhibf fhibf requested a review from a team as a code owner June 15, 2026 20:46
@fhibf fhibf added Enhancement Enhancement on existing functionality. Area-SQL Area related to the SQL Server data provider No-Issue-Activity This issue is now considered stale and will be closed soon Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs No-PaaS-breaking-change No-ADR ADR not needed labels Jun 15, 2026
@fhibf fhibf added this to the FY26\Q4\2Wk\2Wk26 milestone Jun 15, 2026
@fhibf fhibf added Bug Bug bug bug. and removed Enhancement Enhancement on existing functionality. labels Jun 15, 2026
MergeOptions mergeOptions = new MergeOptions(enlistTransaction: true, ensureAtomicOperations: isBundleTransaction);
MergeOptions mergeOptions = new MergeOptions(
enlistTransaction: enlistTransaction,
ensureAtomicOperations: isBundleTransaction);

@SergeyGaluzo SergeyGaluzo Jun 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ensureAtomicOperations always equals to isBundleTransaction. Why not to rename ensureAtomicOperations to match?

// - EnlistTransaction: should be always false, and rely on SQL transactions.

IBundleOrchestratorOperation bundleOperation = _bundleOrchestrator.GetOperation(resource.BundleResourceContext.BundleOperationId);
SetAndClearPendingSearchParameterStatus(resource);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like SetAndClearPendingSearchParameterStatus(resource); can be moved outside any ifs to line 878. Do you mind moving it there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

let's do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-SQL Area related to the SQL Server data provider Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug. No-ADR ADR not needed No-Issue-Activity This issue is now considered stale and will be closed soon No-PaaS-breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants