dotnet / dotnet/EntityFramework.Docs

EF Core DbTransaction - Undocumented IDisposable behaviour on Transactions

Open
#4,973 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

### Type of issue

Missing information

### Description

I tried looking for documentation on what the behaviour of a transaction is when it goes out of scope in the following scenarios:

- When commit is called but the action fails, e.g. illegal transaction and throws an exception
- Commit is never called and the transaction simply goes out of scope
- I've assumed that the transaction failing and being disposed results in some kind of implicit RollBackAsync behaviour
- Additionally the usages of RollbackAsync aren't particularly clear

### Page URL

https://learn.microsoft.com/en-us/ef/core/saving/transactions

### Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/saving/transactions.md

### Document Version Independent Id

cf56babd-def0-d76e-8eee-e33341b6a009

### Article author

@roji

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.