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:

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


Type: Soss.ClientCachedObjectId
Object identifier.
Type: SystemObject
The new value for the object in the shared cache. The argument must be serializable, and it cannot be null.
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.


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.

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