public class ReadWriteEhcacheEntityRegionAccessStrategy extends AbstractReadWriteEhcacheAccessStrategy<EhcacheEntityRegion> implements org.hibernate.cache.access.EntityRegionAccessStrategy
AbstractReadWriteEhcacheAccessStrategy.Item, AbstractReadWriteEhcacheAccessStrategy.Lock, AbstractReadWriteEhcacheAccessStrategy.Lockable
region, settings
Constructor and Description |
---|
ReadWriteEhcacheEntityRegionAccessStrategy(EhcacheEntityRegion region,
org.hibernate.cfg.Settings settings)
Create a read/write access strategy accessing the given entity region.
|
Modifier and Type | Method and Description |
---|---|
boolean |
afterInsert(java.lang.Object key,
java.lang.Object value,
java.lang.Object version) |
boolean |
afterUpdate(java.lang.Object key,
java.lang.Object value,
java.lang.Object currentVersion,
java.lang.Object previousVersion,
org.hibernate.cache.access.SoftLock lock) |
org.hibernate.cache.EntityRegion |
getRegion() |
boolean |
insert(java.lang.Object key,
java.lang.Object value,
java.lang.Object version)
A no-op since this is an asynchronous cache access strategy.
|
boolean |
update(java.lang.Object key,
java.lang.Object value,
java.lang.Object currentVersion,
java.lang.Object previousVersion)
A no-op since this is an asynchronous cache access strategy.
|
decrementLock, get, handleMissingLock, lockItem, putFromLoad, unlockItem
evict, evictAll, lockRegion, putFromLoad, remove, removeAll, unlockRegion
public ReadWriteEhcacheEntityRegionAccessStrategy(EhcacheEntityRegion region, org.hibernate.cfg.Settings settings)
public org.hibernate.cache.EntityRegion getRegion()
getRegion
in interface org.hibernate.cache.access.EntityRegionAccessStrategy
public boolean insert(java.lang.Object key, java.lang.Object value, java.lang.Object version) throws org.hibernate.cache.CacheException
insert
in interface org.hibernate.cache.access.EntityRegionAccessStrategy
org.hibernate.cache.CacheException
public boolean afterInsert(java.lang.Object key, java.lang.Object value, java.lang.Object version) throws org.hibernate.cache.CacheException
Inserts will only succeed if there is no existing value mapped to this key.
afterInsert
in interface org.hibernate.cache.access.EntityRegionAccessStrategy
org.hibernate.cache.CacheException
public boolean update(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion, java.lang.Object previousVersion) throws org.hibernate.cache.CacheException
update
in interface org.hibernate.cache.access.EntityRegionAccessStrategy
org.hibernate.cache.CacheException
public boolean afterUpdate(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion, java.lang.Object previousVersion, org.hibernate.cache.access.SoftLock lock) throws org.hibernate.cache.CacheException
Updates will only succeed if this entry was locked by this transaction and exclusively this transaction for the duration of this transaction. It is important to also note that updates will fail if the soft-lock expired during the course of this transaction.
afterUpdate
in interface org.hibernate.cache.access.EntityRegionAccessStrategy
org.hibernate.cache.CacheException