NamedCacheAcquireLockAsync Method

ScaleOut Software NamedCache API
Asynchronously locks the cached object in SOSS to prevent other clients from updating or removing it.

Namespace:  Soss.Client
Assembly:  soss_namedcache (in soss_namedcache.dll) Version: 6.2.0.0
Syntax

public Task<LockTicket> AcquireLockAsync(
	CachedObjectId id,
	LockTicket lockTicket = null,
	CancellationToken cancellationToken = null
)

Parameters

id
Type: Soss.ClientCachedObjectId
Object identifier.
lockTicket (Optional)
Type: Soss.ClientLockTicket
If specified, the expected LockTicket corresponding to the locked object
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
An optional CancellationToken that can be used to cancel the asynchronous operation.

Return Value

Type: TaskLockTicket
A TaskTResult. The LockTicket can be supplied to other asynchronous API methods to indicate that the caller expects the object to be locked with the given LockTicket.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when id is null.
NotSupportedExceptionThrown when unexpected status is returned from the cache.
ReadThroughTimeoutExceptionThrown if backing store read-through or GeoServer pull replication is used with this NamedCache and the retrieval of the object is delayed beyond the number of retries specified by MaxReadThroughPendingAttempts.
ObjectLockedExceptionUnable to acquire lock while retrieving object.
See Also

Reference