Field NoLockExpiration
Used as the lockTimeout
parameter in Lock method call
to disable locking expirations. This field is read-only.
Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web.dll
Syntax
public static readonly TimeSpan NoLockExpiration
Returns
Type | Description |
---|---|
System.TimeSpan |
Remarks
When used, this field sets the lockTimeout
parameter equal to the System.TimeSpan.Zero
field, which has a constant value of zero. Then the cache item remains locked until explicitly released.
Examples
The following example demonstrates how to use the Lock method to add an item to the Cache object using the NoLockExpiration field.
Cache cache = NCache.InitializeCache("myCache");
LockHandle lockHandle = new LockHandle();
cache.Lock("DSN", Cache.NoLockExpiration, out lockHandle);