|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.hibernate.cache.NonstrictReadWriteCache
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.
for a much stricter algorithm| Nested Class Summary |
| Nested classes inherited from class org.hibernate.cache.CacheConcurrencyStrategy |
CacheConcurrencyStrategy.SoftLock |
| Constructor Summary | |
NonstrictReadWriteCache()
|
|
| Method Summary | |
boolean |
afterInsert(Object key,
Object value,
Object version)
Do nothing. |
boolean |
afterUpdate(Object key,
Object value,
Object version,
CacheConcurrencyStrategy.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 |
CacheConcurrencyStrategy.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,
CacheConcurrencyStrategy.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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public NonstrictReadWriteCache()
| Method Detail |
public void setCache(Cache cache)
CacheConcurrencyStrategy
setCache in interface CacheConcurrencyStrategycache - public Cache getCache()
CacheConcurrencyStrategy
getCache in interface CacheConcurrencyStrategypublic Object get(Object key, long txTimestamp) throws CacheException
get in interface CacheConcurrencyStrategykey - txTimestamp - a timestamp prior to the transaction start time
CacheExceptionpublic boolean put(Object key, Object value, long txTimestamp, Object version, Comparator versionComparator, boolean minimalPut) throws CacheException
put in interface CacheConcurrencyStrategykey - value - txTimestamp - a timestamp prior to the transaction start timeversion - the item version numberversionComparator - a comparator used to compare version numbersminimalPut - indicates that the cache should avoid a put is the item is already cached
CacheExceptionpublic CacheConcurrencyStrategy.SoftLock lock(Object key, Object version) throws CacheException
lock in interface CacheConcurrencyStrategykey - version -
CacheExceptionpublic void remove(Object key) throws CacheException
CacheConcurrencyStrategy
remove in interface CacheConcurrencyStrategykey -
CacheException
public void clear()
throws CacheException
CacheConcurrencyStrategy
clear in interface CacheConcurrencyStrategyCacheExceptionpublic void destroy()
CacheConcurrencyStrategy
destroy in interface CacheConcurrencyStrategypublic void evict(Object key) throws CacheException
evict in interface CacheConcurrencyStrategyCacheExceptionpublic boolean insert(Object key, Object value, Object currentVersion)
insert in interface CacheConcurrencyStrategypublic boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
update in interface CacheConcurrencyStrategypublic void release(Object key, CacheConcurrencyStrategy.SoftLock lock) throws CacheException
release in interface CacheConcurrencyStrategykey -
CacheExceptionpublic boolean afterUpdate(Object key, Object value, Object version, CacheConcurrencyStrategy.SoftLock lock) throws CacheException
afterUpdate in interface CacheConcurrencyStrategyCacheExceptionpublic boolean afterInsert(Object key, Object value, Object version) throws CacheException
afterInsert in interface CacheConcurrencyStrategyCacheExceptionpublic String getRegionName()
CacheConcurrencyStrategy
getRegionName in interface CacheConcurrencyStrategypublic String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||