NamedCacheAdd Method (Byte, Object)

ScaleOut Software NamedCache API
Adds an item to the cache using default parameters. If the object already exists in the cache then it will be updated.

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

public void Add(
	byte[] id,
	Object o


Type: SystemByte
Object identifier (must be either 16 or 32 bytes in length).
Type: SystemObject
Serializable object to store in the cache. If the argument is null then an object with the same id will be removed from the cache.

ObjectLockedExceptionThrown if the object is already in the cache and is locked by another client.
StateServerExceptionThrown if ScaleOut StateServer is unavailable or has experienced an internal error.

The Add(Byte, Object) method will use the cache policy settings from the DefaultCreatePolicy property when adding an object to the cache. If an object with the specified id already exists in the cache then it will be updated. The Insert(Byte, Object, CreatePolicy, Boolean, Boolean) method can be used instead of the Add(Byte, Object) method if this automatic update behavior is not desired.

If an existing cached object is being updated instead of added then the current DefaultCreatePolicy settings will not be applied to the updated object; the object will continue to use the CreatePolicy policies that were in effect when the object was originally added to the cache. The object must be explicitly removed and re-added to the cache for new CreatePolicy policies to take effect.

Use the Insert(Byte, Object, CreatePolicy, Boolean, Boolean) method to add items with specific CreatePolicy parameters instead of the default ones.

See Also