DataCache.GetAndLock Method (String, TimeSpan, out DataCacheLockHandle, String)
Assembly: Microsoft.ApplicationServer.Caching.Client (in microsoft.applicationserver.caching.client.dll)
public Object GetAndLock ( string key, TimeSpan timeout, out DataCacheLockHandle lockHandle, string region )
public Object GetAndLock ( String key, TimeSpan timeout, /** @attribute OutAttribute() */ /** @ref */ DataCacheLockHandle lockHandle, String region )
The unique value that is used to identify the object in the region.
The amount of time that the object remains locked.
The DataCacheLockHandle object required to unlock the object. The lockHandle output parameter is passed by reference.
The name of the region where the object resides.
Return ValueReturns Object matching the specified key parameter if the Object is present and is not locked.
If the key does not exist, a DataCacheException object is thrown with the
ErrorCodeset to KeyDoesNotExist. Create objects based on the referenced key to resolve this error.
If the object is already locked by another cache client, a DataCacheException object is thrown with the
ErrorCodeset to ObjectLocked. The object will be inaccessible until it is unlocked by the locking client.