Assembly: GemStone.GemFire.Cache (in GemStone.GemFire.Cache.dll)
void Add( TKey key, TValue value, Object callbackArg )
|Visual Basic (Declaration)|
Sub Add ( _ key As TKey, _ value As TValue, _ callbackArg As Object _ )
void Add ( TKey key, TValue value, Object^ callbackArg )
The key for which to create the entry in this region. The object is created before the call, and the caller should not deallocate the object.
The value for the new entry, which may be null to indicate that the new entry starts as if it had been locally invalidated.
a custome parameter to pass to the cache writer or cache listener
For local region instance - creates a new entry in this region with the specified key and value in the local cache only. For distributed region instance - The new entry is propogated to the java server to which it is connected with.
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.
|if key is null|
|if an entry with this key already exists|
|if CacheWriter aborts the operation|
|if CacheListener throws an exception|
|If an exception is received from the Java cache server. Only for Native Client regions.|
|if not connected to a 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.|
|if region has been destroyed|
|System..::TimeoutException||if the operation timed out|
|System..::OutOfMemoryException||if there is not enough memory for the new entry|