DatabaseFacade.CommitTransactionAsync(CancellationToken) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Applies the outstanding operations in the current transaction to the database.
public virtual System.Threading.Tasks.Task CommitTransactionAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member CommitTransactionAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.CommitTransactionAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function CommitTransactionAsync (Optional cancellationToken As CancellationToken = Nothing) As Task
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
A Task representing the asynchronous operation.
If the CancellationToken is canceled.
Entity Framework Core does not support multiple parallel operations being run on the same DbContext instance. This includes both parallel execution of async queries and any explicit concurrent use from multiple threads. Therefore, always await async calls immediately, or use separate DbContext instances for operations that execute in parallel. See Avoiding DbContext threading issues for more information and examples.
See Transactions in EF Core for more information and examples.
Product | Versions |
---|---|
Entity Framework Core | 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: