Skip to content

Commit

Permalink
Improve docs on ambient transactions (#4360)
Browse files Browse the repository at this point in the history
Closes #4359
  • Loading branch information
roji authored Jun 1, 2023
1 parent 9d40588 commit 100eab5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions entity-framework/core/saving/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ It is also possible to enlist in an explicit transaction.

[!code-csharp[Main](../../../samples/core/Saving/Transactions/CommitableTransaction.cs?name=Transaction&highlight=1-2,15,28-30)]

> [!NOTE]
> If you're using async APIs, be sure to specify [TransactionScopeAsyncFlowOption.Enabled](/dotnet/api/system.transactions.transactionscopeasyncflowoption) in the `TransactionScoped` constructor to ensure that the ambient transaction flows across async calls.
For more information on `TransactionScope` and ambient transactions, [see this documentation](/dotnet/framework/data/transactions/implementing-an-implicit-transaction-using-transaction-scope).

### Limitations of System.Transactions

1. EF Core relies on database providers to implement support for System.Transactions. If a provider does not implement support for System.Transactions, it is possible that calls to these APIs will be completely ignored. SqlClient supports it.
Expand Down

0 comments on commit 100eab5

Please sign in to comment.