org.hibernate.cache.OptimisticCache |
A contract for transactional cache implementations which support optimistic locking of items within the cache.
The optimisitic locking capabilities are only utilized for the entity cache regions. Unlike the methods on theCache
interface, all the methods
here will only ever be called from access scenarios where versioned
data is actually a possiblity (i.e., entity data). Be sure to consult
with isVersioned()
to determine whether
versioning is actually in effect.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Indicates the "source" of the cached data.
| |||||||||||
Called during
insert(Object, Object, Object) processing for
transactional strategies. | |||||||||||
Called during
put(Object, Object, long, Object, Comparator, boolean) processing for
transactional strategies. | |||||||||||
Called during
update(Object, Object, Object, Object) processing for
transactional strategies. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.hibernate.cache.Cache
|
Indicates the "source" of the cached data. Currently this will
only ever represent an EntityPersister
.
source | The source. |
---|
Called during insert(Object, Object, Object)
processing for
transactional strategies. Indicates we have just performed an insert
into the DB and now need to cache that entity's data.
key | The cache key. |
---|---|
value | The data to be cached. |
currentVersion | The entity's version; or null if not versioned. |
Called during put(Object, Object, long, Object, Comparator, boolean)
processing for
transactional strategies. Indicates we have just loaded an entity's
state from the database and need it cached.
key | The cache key. |
---|---|
value | The data to be cached. |
currentVersion | The entity's version; or null if not versioned. |
Called during update(Object, Object, Object, Object)
processing for
transactional strategies. Indicates we have just performed an update
against the DB and now need to cache the updated state.
key | The cache key. |
---|---|
value | The data to be cached. |
currentVersion | The entity's current version |
previousVersion | The entity's previous version (before the update); or null if not versioned. |