NamedCacheAcquireLock Method (String)

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:

public void AcquireLock(
	string id


Type: SystemString
Object identifier.

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.

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(Byte), Update(Byte, Object, Boolean), SetMetadata(Byte, ObjectMetadata, Boolean), or Remove(Byte). Setting the object to a new value through ItemByte 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, this call will cause the master object to migrate to the local store.

See Also