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 (in Alachisoft.NCache.Web.dll) Version: (


public static readonly TimeSpan NoLockExpiration
Visual Basic
Public Shared ReadOnly NoLockExpiration As TimeSpan
Visual C++
static initonly TimeSpan NoLockExpiration

Field Value

Type: TimeSpan


When used, this field sets the lockTimeout parameter equal to the Zero field, which has a constant value of zero. Then the cache item remains locked untill explicitly released.


The following example demonstrates how to use the Lock method to add an item to the Cache object using the NoLockExpiration field.
 Copy imageCopy
Cache cache = NCache.InitializeCache("myCache");
LockHandle lockHandle = new LockHandle();
cache.Lock("DSN", Cache.NoLockExpiration, out lockHandle);

See Also