Removes the entry with the specified key, passing the callback argument to any cache writers that are invoked in the operation.

Namespace: GemStone.GemFire.Cache.Generic
Assembly:  GemStone.GemFire.Cache (in GemStone.GemFire.Cache.dll)
Version: 3.6.0.0

Syntax

C#
bool Remove(
	TKey key,
	Object callbackArg
)
Visual Basic (Declaration)
Function Remove ( _
	key As TKey, _
	callbackArg As Object _
) As Boolean
Visual C++
bool Remove (
	TKey key, 
	Object^ callbackArg
)

Parameters

key
TKey
the key of the entry to destroy
callbackArg
Object
a user-defined parameter to pass to cache writers triggered by this method

Return Value

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary.

Remarks

Removes not only the value, but also the key and entry from this region.

For local region instance - removes the value with the specified key in the local cache only. For distributed region instance - destroy is propogated to the Gemfire cache server to which it is connected with.

Does not update any CacheStatistics.

Exceptions

ExceptionCondition
[!:IllegalArgumentException]if key is null
[!: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.
System..::TimeoutException if the operation timed out
[!:RegionDestroyedException] if this region has been destroyed

See Also