NamedCacheUpdate Method (Guid, 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.1.0.0
Syntax

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

Parameters

id
Type: SystemGuid
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 obj is null.
Remarks

The Update(Guid, Object, Boolean) method updates an object in the named cache and allows for fine-grained control over locking of the object. Unlike the ItemGuid accessor, the Update(Guid, Object, Boolean) method does not honor the UseLocking property. The AcquireLock(Guid) or Retrieve(Guid, Boolean) method must be called prior to Update(Guid, 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