Skip to content

ITransactionClient Methods

Executes delegates using Orleans transaction semantics.

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

abstract
public abstract Task RunTransaction(TransactionOption transactionOption, Func<Task<bool>> transactionDelegate)
Executes a delegate using the specified transaction option.

Parameters

transactionOptionTransactionOption
The transaction creation, joining, or suppression behavior.
transactionDelegateFunc<Task<bool>>
The delegate to execute. Its result indicates whether the transaction should commit.

Returns

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

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

abstract
public abstract Task RunTransaction(TransactionOption transactionOption, Func<Task<bool>> transactionDelegate, bool useExclusiveLock)
Executes a delegate using the specified transaction option.

Parameters

transactionOptionTransactionOption
The transaction creation, joining, or suppression behavior.
transactionDelegateFunc<Task<bool>>
The delegate to execute. Its result indicates whether the transaction should commit.
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.

RunTransaction(TransactionOption, Func<Task>)

abstract
public abstract Task RunTransaction(TransactionOption transactionOption, Func<Task> transactionDelegate)
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.

Returns

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

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.