OptimisticCachepublic interface OptimisticCache implements CacheA 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 the {@link Cache} 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 {@link OptimisticCacheSource#isVersioned()} to determine whether
versioning is actually in effect. |
Methods Summary |
---|
public void | setSource(OptimisticCacheSource source)Indicates the "source" of the cached data. Currently this will
only ever represent an {@link org.hibernate.persister.entity.EntityPersister}.
Made available to the cache so that it can access certain information
about versioning strategy.
| public void | writeInsert(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion)Called during {@link CacheConcurrencyStrategy#insert} processing for
transactional strategies. Indicates we have just performed an insert
into the DB and now need to cache that entity's data.
| public void | writeLoad(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion)Called during {@link CacheConcurrencyStrategy#put} processing for
transactional strategies. Indicates we have just loaded an entity's
state from the database and need it cached.
| public void | writeUpdate(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion, java.lang.Object previousVersion)Called during {@link CacheConcurrencyStrategy#update} processing for
transactional strategies. Indicates we have just performed an update
against the DB and now need to cache the updated state.
|
|