Execute the given callback having acquired the given lock.
Depending on the JobStore, the surrounding transaction may be
assumed to be already present (managed).
Namespace: Quartz.Impl.AdoJobStore
Assembly: Quartz (in Quartz.dll) Version: 3.0.0
Syntax
C#
protected abstract Task<T> ExecuteInLock<T>( string lockName, Func<ConnectionAndTransactionHolder, Task<T>> txCallback, CancellationToken cancellationToken = null )
Parameters
- lockName
- Type: SystemString
The name of the lock to acquire, for example "TRIGGER_ACCESS". If null, then no lock is acquired, but the lockCallback is still executed in a transaction. - txCallback
- Type: SystemFuncConnectionAndTransactionHolder, TaskT
The callback to execute after having acquired the given lock. - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
The cancellation instruction.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInLock``1(System.String,System.Func{Quartz.Impl.AdoJobStore.ConnectionAndTransactionHolder,System.Threading.Tasks.Task{``0}},System.Threading.CancellationToken)"]
Return Value
Type: TaskT[Missing <returns> documentation for "M:Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInLock``1(System.String,System.Func{Quartz.Impl.AdoJobStore.ConnectionAndTransactionHolder,System.Threading.Tasks.Task{``0}},System.Threading.CancellationToken)"]
See Also