NCache 4.6 - Online Documentation

Locking Items Using Cache Item Versioning (Optimistic Locking)

 
CacheItemVersion adds an additional dimension to the development of application using NCache. Optimistic Concurrency can be achieved in applications by NCache Item Versioning.
When any item is added in cache, cache item version is returned to the cache client. This value denotes the number of updates performed on a particular data. With every update, item version value is incremented.
 
      To utilize the API, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
In this section:
 
Explains how the item version can be saved for the first time.
 
Explains how an item can be updated with a specific version.
 
Explains how cached item with a specific version can be fetched from cache.
 
Explains how an item can be fetched from cache if a newer version of it exists.
 
Explains how an item with a specified item version can be fetched from the cache.
 
Explains how an item with a specified item version can be deleted from the cache.