Puts a new value into an entry in this region with the specified key,
passing the callback argument to any cache writers that are invoked
in the operation.
Namespace: GemStone.GemFire.Cache
Assembly: GemStone.GemFire.Cache (in GemStone.GemFire.Cache.dll)
Version: 2.5.0.1
Syntax
| C# |
|---|
public void Put( CacheableKey key, IGFSerializable value ) |
| Visual Basic (Declaration) |
|---|
Public Sub Put ( _ key As CacheableKey, _ value As IGFSerializable _ ) |
| Visual C++ |
|---|
public: void Put ( CacheableKey^ key, IGFSerializable^ value ) |
Parameters
- key
- CacheableKey
a key object allocated before the call, and caller should not deallocate this object
- value
- IGFSerializable
the value to be put into this region
Remarks
If there is already an entry associated with the specified key in this region, the entry's previous value is overwritten. @nativeclient The new put value is propogated to the java server to which it is connected with. @endnativeclient 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 LastAccessedTime and LastModifiedTime for this region and the entry.
Exceptions
| Exception | Condition |
|---|---|
| GemStone.GemFire.Cache..::IllegalArgumentException | if key is null |
| GemStone.GemFire.Cache..::CacheServerException | If an exception is received from the Java cache server. Only for Native Client regions. |
| GemStone.GemFire.Cache..::NotConnectedException | if not connected to the GemFire system because the client cannot establish usable connections to any of the servers given to it. |
| GemStone.GemFire.Cache..::RegionDestroyedException | if region has been destroyed |
| GemStone.GemFire.Cache..::TimeoutException | if the operation timed out |
| GemStone.GemFire.Cache..::OutOfMemoryException | if there is not enough memory for the value |