Namespaces

Types

Type ReadWriteCache

Namespace NHibernate.Cache

Interfaces ICacheConcurrencyStrategy

Methods

Properties

Public instance methods

void AfterInsert(CacheKey key, object value, object version)

Parameters
CacheKey key
object value
object version

void AfterUpdate(CacheKey key, object value, object version, ISoftLock clientLock)

Re-cache the updated state, if and only if there there are no other concurrent soft locks. Release our lock.
Parameters
CacheKey key
object value
object version
ISoftLock clientLock

void Clear()

void Destroy()

bool Equals(object obj)

Parameters
return bool
object obj

void Evict(CacheKey key)

Parameters
CacheKey key

object Get(CacheKey key, long txTimestamp)

Do not return an item whose timestamp is later than the current transaction timestamp. (Otherwise we might compromise repeatable read unnecessarily.) Do not return an item which is soft-locked. Always go straight to the database instead.
Note that since reading an item from that cache does not actually go to the database, it is possible to see a kind of phantom read due to the underlying row being updated after we have read it from the cache. This would not be possible in a lock-based implementation of repeatable read isolation. It is also possible to overwrite changes made and committed by another transaction after the current transaction read the item from the cache. This problem would be caught by the update-time version-checking, if the data is versioned or timestamped.
Parameters
return object
CacheKey key
long txTimestamp

int GetHashCode()

Parameters
return int

Type GetType()

Parameters
return Type

void Insert(CacheKey key, object value)

Parameters
CacheKey key
object value

ISoftLock Lock(CacheKey key, object version)

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.
Parameters
return ISoftLock
CacheKey key
object version

bool Put(CacheKey key, object value, long txTimestamp, object version, IComparer versionComparator, bool minimalPut)

Do not add an item to the cache unless the current transaction timestamp is later than the timestamp at which the item was invalidated. (Otherwise, a stale item might be re-added if the database is operating in repeatable read isolation mode.)
Parameters
return bool Whether the item was actually put into the cache
CacheKey key
object value
long txTimestamp
object version
IComparer versionComparator
bool minimalPut

void Release(CacheKey key, ISoftLock clientLock)

Parameters
CacheKey key
ISoftLock clientLock

void Remove(CacheKey key)

Parameters
CacheKey key

string ToString()

Parameters
return string

void Update(CacheKey key, object value)

Parameters
CacheKey key
object value

Public properties

ICache Cache get; set;

return ICache

string RegionName get;

Gets the cache region name.
return string