Namespaces

Types

Type ICacheConcurrencyStrategy

Namespace NHibernate.Cache

Methods

Properties

Public instance methods

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

Called after an item has been inserted (after the transaction completes), instead of calling release().
This method is used by "asynchronous" concurrency strategies.
Parameters
CacheKey key
object value
object version

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

Called after an item has been updated (after the transaction completes), instead of calling Release().
This method is used by "asynchronous" concurrency strategies.
Parameters
CacheKey key
object value
object version
ISoftLock lock

void Clear()

Evict all items from the cache immediately.

void Destroy()

Clean up all resources.

void Evict(CacheKey key)

Called after an item has become stale (before the transaction completes).
This method is used by "synchronous" concurrency strategies.
Parameters
CacheKey key

object Get(CacheKey key, long txTimestamp)

Attempt to retrieve an object from the Cache
Parameters
return object ${WriteSummary(content)}
CacheKey key The key (id) of the object to get out of the Cache.
long txTimestamp A timestamp prior to the transaction start time

void Insert(CacheKey key, object value)

Called after an item has been inserted (before the transaction completes), instead of calling Evict().
This method is used by "synchronous" concurrency strategies.
Parameters
CacheKey key
object value

ISoftLock Lock(CacheKey key, object version)

We are going to attempt to update/delete the keyed object
This method is used by "asynchronous" concurrency strategies.
Parameters
return ISoftLock
CacheKey key The key
object version

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

Attempt to cache an object, after loading from the database
Parameters
return bool ${WriteSummary(content)}
CacheKey key The key (id) of the object to put in the Cache.
object value The value
long txTimestamp A timestamp prior to the transaction start time
object version the version number of the object we are putting
IComparer versionComparer a Comparer to be used to compare version numbers
bool minimalPut indicates that the cache should avoid a put if the item is already cached

void Release(CacheKey key, ISoftLock lock)

Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.
This method is used by "asynchronous" concurrency strategies.
Parameters
CacheKey key The key
ISoftLock lock The soft lock

void Remove(CacheKey key)

Evict an item from the cache immediately (without regard for transaction isolation).
Parameters
CacheKey key

void Update(CacheKey key, object value)

Called after an item has been updated (before the transaction completes), instead of calling Evict().
This method is used by "synchronous" concurrency strategies.
Parameters
CacheKey key
object value

Public properties

ICache Cache get; set;

Gets or sets the ICache for this strategy to use.
return ICache

string RegionName get;

Gets the cache region name.
return string