Skip to content

Document automatic transaction behavior - #5458

Open
AndriySvyryd with Copilot wants to merge 4 commits into
mainfrom
copilot/document-autotransactionbehavior
Open

Document automatic transaction behavior#5458
AndriySvyryd with Copilot wants to merge 4 commits into
mainfrom
copilot/document-autotransactionbehavior

Conversation

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

EF Core 7.0 introduced AutoTransactionBehavior to control when SaveChanges automatically starts a transaction.

  • Behavior
    • Document WhenNeeded, Always, and Never.
    • Explain performance and consistency implications.
  • Usage
    • Show how to force transactions for interception scenarios.
    • Warn that Never can leave partial changes after failures.
context.Database.AutoTransactionBehavior = AutoTransactionBehavior.Always;

Copilot AI linked an issue Aug 19, 2026 that may be closed by this pull request
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Document AutoTransactionBehavior in EF Core 7.0 Document automatic transaction behavior Aug 19, 2026
Copilot AI requested a review from AndriySvyryd August 19, 2026 23:08
@AndriySvyryd
AndriySvyryd requested a lite review from Copilot August 20, 2026 00:27

Copilot AI left a comment

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.

Pull request overview

Documents EF Core 7.0+ automatic transaction behavior for SaveChanges, helping readers understand when EF Core creates transactions by default and how to override that behavior for performance, consistency, and interception scenarios.

Changes:

  • Added a new “Controlling automatic transactions” section describing AutoTransactionBehavior (WhenNeeded, Always, Never).
  • Included a short usage snippet showing how to force automatic transactions.
  • Updated page metadata date.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread entity-framework/core/saving/transactions.md Outdated
Comment thread entity-framework/core/saving/transactions.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread entity-framework/core/saving/transactions.md Outdated
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document AutoTransactionBehavior

3 participants