NamedCacheUpdate Method (CachedObjectId, Object, Boolean)

ScaleOut Software NamedCache API
Updates an object in the named cache.

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

public void Update(
	CachedObjectId id,
	Object obj,
	bool unlockAfterUpdate
)

Parameters

id
Type: Soss.ClientCachedObjectId
Object identifier.
obj
Type: SystemObject
The new value for the object in the shared cache. The argument must be serializable, and it cannot be null.
unlockAfterUpdate
Type: SystemBoolean

If the NamedCache instance is not holding a lock for the specified object, this parameter is ignored.

If unlockAfterUpdate is true and the NamedCache is holding a lock for the object then the lock will be released when the update operation completes.

If unlockAfterUpdate is false and the NamedCache is holding a lock for the object then the lock will continue to be held when the update operation completes.

Exceptions

ExceptionCondition
ObjectNotFoundExceptionThrown if the object to update does not exist in the cache.
StateServerExceptionThrown if ScaleOut StateServer is unavailable or has experienced an internal error.
ArgumentNullExceptionThrown if id or obj is null.
Remarks

The Update(CachedObjectId, Object, Boolean) method updates an object in the named cache and allows for fine-grained control over locking of the object. Unlike the ItemCachedObjectId accessor, the Update(CachedObjectId, Object, Boolean) method does not honor the UseLocking property. The AcquireLock(CachedObjectId) or Retrieve(CachedObjectId, Boolean) methods must be called prior to Update(CachedObjectId, Object, Boolean) if the object needs to be locked.

Care should be taken when performing unlocked updates on objects. An unlocked update will not block for locks held by another clients, so other clients may have the object data changed underneath them despite the locks they hold.

See Also

Reference