NamedCacheAdd Method (String, 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: 6.1.0.0
Syntax

public void Add(
	string id,
	Object o
)

Parameters

id
Type: SystemString
Object identifier.
o
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.
Exceptions

ExceptionCondition
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.
Remarks

The Add(String, 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(String, Object, CreatePolicy, Boolean, Boolean) method can be used instead of the Add(String, 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(String, Object, CreatePolicy, Boolean, Boolean) method to add items with specific CreatePolicy parameters instead of the default ones.

See Also

Reference