public class

NonstrictReadWriteCache

extends Object
implements CacheConcurrencyStrategy
java.lang.Object
   ↳ org.hibernate.cache.NonstrictReadWriteCache

Class Overview

Caches data that is sometimes updated without ever locking the cache. If concurrent access to an item is possible, this concurrency strategy makes no guarantee that the item returned from the cache is the latest version available in the database. Configure your cache timeout accordingly! This is an "asynchronous" concurrency strategy.

Summary

Public Constructors
NonstrictReadWriteCache()
Public Methods
boolean afterInsert(Object key, Object value, Object version)
Do nothing.
boolean afterUpdate(Object key, Object value, Object version, SoftLock lock)
Invalidate the item (again, for safety).
void clear()
Evict all items from the cache immediately.
void destroy()
Clean up all resources.
void evict(Object key)
Invalidate the item
Object get(Object key, long txTimestamp)
Get the most recent version, if available.
Cache getCache()
Get the wrapped cache implementation
String getRegionName()
Get the cache region name
boolean insert(Object key, Object value, Object currentVersion)
Invalidate the item
SoftLock lock(Object key, Object version)
Do nothing.
boolean put(Object key, Object value, long txTimestamp, Object version, Comparator versionComparator, boolean minimalPut)
Add an item to the cache.
void release(Object key, SoftLock lock)
Invalidate the item (again, for safety).
void remove(Object key)
Evict an item from the cache immediately (without regard for transaction isolation).
void setCache(Cache cache)
Set the underlying cache implementation.
String toString()
boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
Do nothing.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.cache.CacheConcurrencyStrategy

Public Constructors

public NonstrictReadWriteCache ()

Public Methods

public boolean afterInsert (Object key, Object value, Object version)

Do nothing.

public boolean afterUpdate (Object key, Object value, Object version, SoftLock lock)

Invalidate the item (again, for safety).

public void clear ()

Evict all items from the cache immediately.

public void destroy ()

Clean up all resources.

public void evict (Object key)

Invalidate the item

public Object get (Object key, long txTimestamp)

Get the most recent version, if available.

Parameters
txTimestamp a timestamp prior to the transaction start time
Returns
  • the cached object or null

public Cache getCache ()

Get the wrapped cache implementation

public String getRegionName ()

Get the cache region name

public boolean insert (Object key, Object value, Object currentVersion)

Invalidate the item

public SoftLock lock (Object key, Object version)

Do nothing.

Returns
  • null, no lock

public boolean put (Object key, Object value, long txTimestamp, Object version, Comparator versionComparator, boolean minimalPut)

Add an item to the cache.

Parameters
txTimestamp a timestamp prior to the transaction start time
version the item version number
versionComparator a comparator used to compare version numbers
minimalPut indicates that the cache should avoid a put is the item is already cached
Returns
  • true if the object was successfully cached

public void release (Object key, SoftLock lock)

Invalidate the item (again, for safety).

public void remove (Object key)

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

public void setCache (Cache cache)

Set the underlying cache implementation.

public String toString ()

public boolean update (Object key, Object value, Object currentVersion, Object previousVersion)

Do nothing.