Share via


DataCache.Unlock Method (String, DataCacheLockHandle, TimeSpan, String)

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object.

Namespace: Microsoft.Data.Caching
Assembly: ClientLibrary (in clientlibrary.dll)

Syntax

'Declaration
Public Sub Unlock ( _
    key As String, _
    lockHandle As DataCacheLockHandle, _
    timeout As TimeSpan, _
    region As String _
)
'Usage
Dim instance As DataCache
Dim key As String
Dim lockHandle As DataCacheLockHandle
Dim timeout As TimeSpan
Dim region As String

instance.Unlock(key, lockHandle, timeout, region)
public void Unlock (
    string key,
    DataCacheLockHandle lockHandle,
    TimeSpan timeout,
    string region
)
public:
void Unlock (
    String^ key, 
    DataCacheLockHandle^ lockHandle, 
    TimeSpan timeout, 
    String^ region
)
public void Unlock (
    String key, 
    DataCacheLockHandle lockHandle, 
    TimeSpan timeout, 
    String region
)
public function Unlock (
    key : String, 
    lockHandle : DataCacheLockHandle, 
    timeout : TimeSpan, 
    region : String
)

Parameters

  • key
    The unique value that is used to identify the object in the region.
  • timeout
    A non-zero value that is used to specify how many minutes the object should reside in the cache before expiration.
  • region
    The name of the region where the object resides.

Remarks

The lockHandle parameter is required and must match the DataCacheLockHandle of the locked object to succeed. For more information about concurrency, see Concurrency Models (Velocity) and Concurrency Methods (Velocity).

Locked objects are never expired, but they may expire immediately if unlocked after their expiration time. For more information, see Expiration and Eviction (Velocity).

The timeout value associated with the cached object overrides expiration settings specified in the named cache configuration. For more information, see Expiration and Eviction (Velocity).

See Also

Reference

DataCache Class
DataCache Members
Microsoft.Data.Caching Namespace