Click or drag to resize

DataAccessAdapterCore.StartTransactionAsync Method (IsolationLevel, String, CancellationToken)

Async variant of StartTransaction(IsolationLevel, String). Starts a new transaction. All database activity after this call will be ran in this transaction and all objects will participate in this transaction until its committed or rolled back. If there is a transaction in progress, an exception is thrown. Will create and open a new connection if a transaction is not open and/or available.

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.5.0.0 (5.5.18.1019)
Syntax
public virtual Task StartTransactionAsync(
	IsolationLevel isolationLevelToUse,
	string name,
	CancellationToken cancellationToken
)

Parameters

isolationLevelToUse
Type: System.Data.IsolationLevel
The isolation level to use for this transaction
name
Type: System.String
The name for this transaction
cancellationToken
Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task

Implements

IDataAccessAdapter.StartTransactionAsync(IsolationLevel, String, CancellationToken)
Exceptions
ExceptionCondition
InvalidOperationExceptionIf a transaction is already in progress.
Remarks
If this DataAccessAdapter is in a System.Transactions.Transaction, no real ado.net transaction will be started, as a transaction is already in progress. In that situation, this method will just open the connection if required.
See Also