Skip to content

ITransactionClient.RunTransaction(TransactionOption, Func<Task>, bool)

RunTransaction(TransactionOption, Func<Task>, bool)

abstract
public abstract Task RunTransaction(TransactionOption transactionOption, Func<Task> transactionDelegate, bool useExclusiveLock)
Executes a delegate using the specified transaction option. A newly created transaction commits when the delegate completes successfully; a joined transaction records this participant's commit vote.

Parameters

transactionOptionTransactionOption
The transaction creation, joining, or suppression behavior.
transactionDelegateFunc<Task>
The delegate to execute.
useExclusiveLockbool
When true, all transactional states accessed during this transaction will acquire exclusive locks even for read operations, preventing lock upgrade conflicts under high contention.

Returns

A System.Threading.Tasks.Task representing the transaction operation.