NamedCacheAcquireLock Method (CachedObjectId)

ScaleOut Software NamedCache API
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 void AcquireLock(
	CachedObjectId id
)

Parameters

id
Type: Soss.ClientCachedObjectId
Object identifier.
Exceptions

ExceptionCondition
ObjectLockedExceptionThrown if the object is already locked by another client.
ObjectNotFoundExceptionThrown if the object does not exist.
StateServerExceptionThrown if ScaleOut StateServer is unavailable or has experienced an internal error.
ReadThroughTimeoutExceptionThrown if GeoServer pull replication is configured and the local store is unable to take over mastership of the object after exceeding the number of retries specified by MaxReadThroughPendingAttempts.
Remarks

This call will block until the lock is acquired or the MaxLockAttempts limit has been met. The lock is released through a call to ReleaseLock(CachedObjectId), Update(CachedObjectId, Object, Boolean), SetMetadata(CachedObjectId, ObjectMetadata, Boolean), or Remove(CachedObjectId). Setting the object to a new value through ItemCachedObjectId while UseLocking is true will also cause the lock to be released. If no subsequent call is made, the lock will expire after approximately 90 seconds. Calling this method on an instance of the NamedCache that already has a lock on the cached object will reset the 90 second lock timeout.

If GeoServer pull replication is being used, this call will cause the master object to migrate to the local store.

See Also

Reference