Share via


DataCache.Unlock Method (String, DataCacheLockHandle, TimeSpan)

 

Releases objects locked in the cache. 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.ApplicationServer.Caching
Assembly:  Microsoft.ApplicationServer.Caching.Client (in Microsoft.ApplicationServer.Caching.Client.dll)

Syntax

public void Unlock(
    string key,
    DataCacheLockHandle lockHandle,
    TimeSpan timeout
)
public:
void Unlock(
    String^ key,
    DataCacheLockHandle^ lockHandle,
    TimeSpan timeout
)
member Unlock : 
        key:string *
        lockHandle:DataCacheLockHandle *
        timeout:TimeSpan -> unit
Public Sub Unlock (
    key As String,
    lockHandle As DataCacheLockHandle,
    timeout As TimeSpan
)

Parameters

  • key
    Type: System.String

    The unique value that is used to identify the object in the region.

  • timeout
    Type: System.TimeSpan

    The amount of time that the object should reside in the cache before expiration.

Remarks

The lockHandle parameter is required and must match the DataCacheLockHandle of the locked object to succeed.

Locked objects are never expired, but they may expire immediately if unlocked after their expiration time.

The timeout value associated with the cached object overrides expiration settings specified in the named cache configuration.

See Also

Unlock Overload
DataCache Class
Microsoft.ApplicationServer.Caching Namespace

Return to top