insert -> afterInsertlockItem -> update -> afterUpdatelockItem -> remove -> unlockItemputFromLoad
There is another usage pattern that is used to invalidate entries
after performing "bulk" HQL/SQL operations:
lockRegion -> removeAll -> unlockRegion
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: Were the contents of the cache actual changed by this operation?Current session session, Object The item key key, Object The item value, Object The item's version value version)Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). |
| public boolean | Returns: Were the contents of the cache actually changed by this operation?Current session session, Object The item key key, Object The item value, Object The item's current version value currentVersion, Object The item's previous version value previousVersion, SoftLock The lock previously obtained from lock)lockItemCalled afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release(). |
| public Object | Returns: a key which can be used to identify this entity on this same region todo (6.0) : the access for an entity knows the entity hierarchy and the factory. why pass them in?the primary identifier of the entity id, EntityPersister Hierarchy for which a key is being generated rootEntityDescriptor, SessionFactoryImplementor a reference to the current SessionFactory factory, String the tenant id, or null if multi-tenancy is not being used. tenantIdentifier)
Deprecated
as a consequence of
To create instances of keys for this region, Hibernate will invoke this method
exclusively so that generated implementations can generate optimised keys.
SessionFactoryImplementor being deprecated.
|
| public Object | Returns: original id passed togenerateCacheKeykey previously returned from cacheKey)generateCacheKeyPerforms reverse operation to |
| public boolean | Returns: Were the contents of the cache actually changed by this operation?Current session session, Object The item key key, Object The item value, Object The item's version value version)Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). |
| public boolean | Returns: Were the contents of the cache actually changed by this operation?Current session session, Object The item key key, Object The item value, Object The item's current version value currentVersion, Object The item's previous version value previousVersion)Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). |
| afterInsert | back to summary |
|---|---|
| public boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version) Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
| |
| afterUpdate | back to summary |
|---|---|
| public boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) Called afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
| |
| generateCacheKey | back to summary |
|---|---|
| public Object generateCacheKey(Object id, EntityPersister rootEntityDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)
Deprecated as a consequence of To create instances of keys for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.
| |
| getCacheKeyId | back to summary |
|---|---|
| public Object getCacheKeyId(Object cacheKey) Performs reverse operation to
| |
| insert | back to summary |
|---|---|
| public boolean insert(SharedSessionContractImplementor session, Object key, Object value, Object version) Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
| |
| update | back to summary |
|---|---|
| public boolean update(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion) Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
| |