NamedCacheItem Property (String)

ScaleOut Software NamedCache API
Gets or sets a cached item using default parameters.

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

public Object this[
	string id
] { get; set; }

Parameters

id
Type: SystemString
Identifier of the object in the cache.

Return Value

Type: Object
The object stored in the cache, or null if the object is not in the cache.
Exceptions

ExceptionCondition
ObjectLockedExceptionThrown if UseLocking is true but the object is locked by another client.
StateServerExceptionThrown if ScaleOut StateServer is unavailable or has experienced an internal error.
ReadThroughTimeoutExceptionThrown if backing store read-through or GeoServer pull replication is used with this NamedCache and the retrieval of the object is delayed beyond the number of retries specified by MaxReadThroughPendingAttempts.
Remarks

If UseLocking is true then a "get" operation will cause the object to be locked in the SOSS server, and no other clients will be able to acquire a lock until the lock from this instance of the NamedCache is released (either by setting the object to a new value or calling ReleaseLock).

The "set" operation will either add a new object to the named cache (using policies defined in DefaultCreatePolicy) or update an existing item with the same ID. Passing a null value will cause an object to be removed from the cache. The UseLocking property is honored when setting a cached item to null, so the API will attempt to acquire a lock on the object prior to removing it if UseLocking is true.

Note that every get/set call will cause a round trip to the SOSS service and could result in the retrieval or update of a cached object across the network.

Object identifiers passed into this property are hashed into keys using the system's preferred SHA256 hash algorithm (typically SHA256Managed) prior to being sent to ScaleOut StateServer. The choice of HashAlgorithm is configurable. See Mapping Algorithm Names to Cryptography Classes for details on how to map a different provider to the Create call that the API uses internally.

If GeoServer pull replication is being used, the NamedCache's DefaultGeoServerReadMode property will determine this getter's GeoServer read behavior when accessing an object in a remote store.

See Also

Reference