Click or drag to resize
RegionPut Method (ICacheableKey, IGFSerializable)
Puts a new value into an entry in this region with the specified key.

Namespace: GemStone.GemFire.Cache
Assembly: Gemstone.Gemfire.Cache (in Gemstone.Gemfire.Cache.dll) Version: 9.0.6.18
Syntax
public void Put(
	ICacheableKey key,
	IGFSerializable value
)

Parameters

key
Type: GemStone.GemFire.CacheICacheableKey
a key object associated with the value to be put into this region.
value
Type: GemStone.GemFire.CacheIGFSerializable
the value to be put into this region
Exceptions
ExceptionCondition
IllegalArgumentException if key is null
CacheWriterException if CacheWriter aborts the operation
CacheListenerException if CacheListener throws an exception
RegionDestroyedException if region has been destroyed
CacheServerException If an exception is received from the Java cache server. Only for Native Client regions.
NotConnectedException if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException.
TimeoutException if the operation timed out
OutOfMemoryException if there is not enough memory for the value
Remarks

If there is already an entry associated with the specified key in this region, the entry's previous value is overwritten. The new put value is propogated to the java server to which it is connected with. Put is intended for very simple caching situations. In general it is better to create a ICacheLoader object and allow the cache to manage the creation and loading of objects.

Updates the [!:CacheStatistics.LastAccessedTime] and [!:CacheStatistics.LastModifiedTime] for this region and the entry.

If remote server put fails throwing back a CacheServerException or security exception, then local put is tried to rollback. However, if the entry has overflowed/evicted/expired then the rollback is aborted since it may be due to a more recent notification or update by another thread.

See Also