public class NaturalIdNonStrictReadWriteAccess extends AbstractNaturalIdDataAccess
Standard support for NaturalIdDataAccess
using the AccessType.NONSTRICT_READ_WRITE
access type.
Constructor and Description |
---|
NaturalIdNonStrictReadWriteAccess(DomainDataRegion region,
CacheKeysFactory keysFactory,
DomainDataStorageAccess storageAccess,
NaturalIdDataCachingConfig config) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterInsert(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been inserted (afterQuery the transaction completes),
instead of calling release().
|
AccessType |
getAccessType()
The type of access implemented
|
boolean |
insert(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been inserted (beforeQuery the transaction completes),
instead of calling evict().
|
void |
remove(SharedSessionContractImplementor session,
Object key)
Called afterQuery an item has become stale (beforeQuery the transaction completes).
|
void |
unlockItem(SharedSessionContractImplementor session,
Object key,
SoftLock lock)
Called when we have finished the attempted update/delete (which may or
may not have been successful), after transaction completion.
|
boolean |
update(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been updated (beforeQuery the transaction completes),
instead of calling evict().
|
afterUpdate, generateCacheKey, getNaturalIdValues, lockItem, lockRegion, unlockRegion
clearCache, contains, destroy, evict, evictAll, get, getRegion, getStorageAccess, putFromLoad, putFromLoad, removeAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, evict, evictAll, get, getRegion, putFromLoad, putFromLoad, removeAll
public NaturalIdNonStrictReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig config)
public AccessType getAccessType()
CachedDomainDataAccess
The type of access implemented
public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)
CachedDomainDataAccess
Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.
unlockItem
in interface CachedDomainDataAccess
unlockItem
in class AbstractNaturalIdDataAccess
session
- Current session.key
- The item keylock
- The lock previously obtained from CachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
public void remove(SharedSessionContractImplementor session, Object key)
CachedDomainDataAccess
Called afterQuery an item has become stale (beforeQuery the transaction completes). This method is used by "synchronous" concurrency strategies.
remove
in interface CachedDomainDataAccess
remove
in class AbstractCachedDomainDataAccess
session
- Current session.key
- The key of the item to removepublic boolean insert(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccess
Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
insert
in interface NaturalIdDataAccess
insert
in class AbstractNaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itempublic boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccess
Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
afterInsert
in interface NaturalIdDataAccess
afterInsert
in class AbstractNaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itempublic boolean update(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccess
Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
update
in interface NaturalIdDataAccess
update
in class AbstractNaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itemCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.