Language
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Updates the locked object and then releases the lock. This method supports pessimistic concurrency by making sure that the appropriate LockHandle is used for unlocking the object. Additionally, this overload allows you to save your object to a region, update tags associated with the object, and specify an object time-out that overrides the default settings for the cache.
Namespace: System.Data.Caching
Assembly: ClientLibrary (in clientlibrary.dll)
Syntax
'Declaration
Public Function PutAndUnlock ( _
region As String, _
key As String, _
value As Object, _
timeOut As TimeSpan, _
lockHandle As LockHandle, _
tags As Tag() _
) As CacheItemVersion
'Usage
Dim instance As Cache
Dim region As String
Dim key As String
Dim value As Object
Dim timeOut As TimeSpan
Dim lockHandle As LockHandle
Dim tags As Tag()
Dim returnValue As CacheItemVersion
returnValue = instance.PutAndUnlock(region, key, value, timeOut, lockHandle, tags)
public CacheItemVersion PutAndUnlock (
string region,
string key,
Object value,
TimeSpan timeOut,
LockHandle lockHandle,
Tag[] tags
)
public:
CacheItemVersion^ PutAndUnlock (
String^ region,
String^ key,
Object^ value,
TimeSpan timeOut,
LockHandle lockHandle,
array<Tag^>^ tags
)
public CacheItemVersion PutAndUnlock (
String region,
String key,
Object value,
TimeSpan timeOut,
LockHandle lockHandle,
Tag[] tags
)
public function PutAndUnlock (
region : String,
key : String,
value : Object,
timeOut : TimeSpan,
lockHandle : LockHandle,
tags : Tag[]
) : CacheItemVersion
Parameters
- region
The name of the region. Use DefaultRegion if the object is not stored in a region.
- key
The unique value that is used to identify the object in the region or cache. If this parameter is null, an exception is thrown.
- value
The object saved to the cache cluster.
- timeOut
A non-zero time to live (TTL) value that is used to specify how many minutes the object should reside in the cache before expiring.
- lockHandle
The LockHandle object corresponding to the lock on the cached object.
- tags
An array of Tag objects to associate with the cached object inside the region. If the region name is not provided, all tags are ignored.
Return Value
A CacheItemVersion object that represents the version of the cached object after it has been updated by this method. If the lockHandle parameter is not equal to the LockHandle object obtained from the method that is used to lock the object; null is returned and the object is not updated.
Remarks
Tags may only be used to retrieve a cached object if that object is saved to a region. Until a region name is provided, tags are ignored.
The lockHandle parameter is required and must match the LockHandle 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; this may be prevented by using the timeOut parameter. 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).