Stop any other transactions reading or writing this item to/from the cache. Send them straight to the database instead. (The lock does time out eventually.) This implementation tracks concurrent locks by transactions which simultaneously attempt to write to an item.

Namespace: NHibernate.Cache
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public ISoftLock Lock(
	CacheKey key,
	Object version
)
Visual Basic
Public Function Lock ( _
	key As CacheKey, _
	version As Object _
) As ISoftLock
Visual C++
public:
virtual ISoftLock^ Lock(
	CacheKey^ key, 
	Object^ version
) sealed

Parameters

key
Type: NHibernate.Cache..::..CacheKey

[Missing <param name="key"/> documentation for "M:NHibernate.Cache.ReadWriteCache.Lock(NHibernate.Cache.CacheKey,System.Object)"]

version
Type: System..::..Object

[Missing <param name="version"/> documentation for "M:NHibernate.Cache.ReadWriteCache.Lock(NHibernate.Cache.CacheKey,System.Object)"]

Return Value

[Missing <returns> documentation for "M:NHibernate.Cache.ReadWriteCache.Lock(NHibernate.Cache.CacheKey,System.Object)"]

Implements

ICacheConcurrencyStrategy..::..Lock(CacheKey, Object)

See Also