Module org.eclipse.persistence.core
Class UnitOfWorkIdentityMap
java.lang.Object
org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
org.eclipse.persistence.internal.identitymaps.FullIdentityMap
org.eclipse.persistence.internal.identitymaps.UnitOfWorkIdentityMap
- All Implemented Interfaces:
Serializable,Cloneable,IdentityMap
- Direct Known Subclasses:
WeakUnitOfWorkIdentityMap
Unit of work specific identity map which avoid additional overhead not required in unit of work,
such as locking and synchronization.
- Since:
- TopLink 10.1.3.1
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.identitymaps.FullIdentityMap
cacheKeysFields inherited from class org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
descriptor, isIsolated, maxSize, session -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUnitOfWorkIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated) -
Method Summary
Modifier and TypeMethodDescriptionacquireDeferredLock(Object primaryKey, boolean isCacheCheckComplete) Avoid acquiring any lock as uow is single threaded.acquireLock(Object primaryKey, boolean forMerge, boolean isCacheCheckComplete) Avoid acquiring any lock as uow is single threaded.acquireLockNoWait(Object primaryKey, boolean forMerge) Avoid acquiring any lock as uow is single threaded.acquireLockWithWait(Object primaryKey, boolean forMerge, int wait) Avoid acquiring any lock as uow is single threaded.acquireReadLockOnCacheKey(Object primaryKey) Avoid acquiring any lock as uow is single threaded.acquireReadLockOnCacheKeyNoWait(Object primaryKey) Avoid acquiring any lock as uow is single threaded.createCacheKey(Object primaryKey, Object object, Object writeLockValue, long readTime) Create the correct type of CacheKey for this map.protected CacheKeygetCacheKeyWithReadLock(Object primaryKey) Avoid acquiring any lock as uow is single threaded.protected CacheKeyputCacheKeyIfAbsent(CacheKey searchKey) Use hashmap put, as no concurrency in unit of work.Avoid acquiring any lock as uow is single threaded.voidresetCacheKey(CacheKey key, Object object, Object writeLockValue, long readTime) Avoid acquiring any lock as uow is single threaded.voidsetWriteLockValue(Object primaryKey, Object writeLockValue) Avoid acquiring any lock as uow is single threaded.Methods inherited from class org.eclipse.persistence.internal.identitymaps.FullIdentityMap
clone, cloneKeys, collectLocks, elements, getCacheKey, getCacheKeys, getSize, getSize, keys, keys, lazyRelationshipLoaded, put, setCacheKeysMethods inherited from class org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
containsKey, get, getAllCacheKeysFromIdentityMapWithEntityPK, getAllFromIdentityMapWithEntityPK, getCacheKeyForLock, getDefaultIdentityMapClass, getDescriptor, getDescriptorClass, getMaxSize, getWrapper, getWriteLockValue, release, remove, setDescriptor, setMaxSize, setWrapper, toString, updateMaxSize
-
Constructor Details
-
UnitOfWorkIdentityMap
protected UnitOfWorkIdentityMap() -
UnitOfWorkIdentityMap
public UnitOfWorkIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated)
-
-
Method Details
-
createCacheKey
public CacheKey createCacheKey(Object primaryKey, Object object, Object writeLockValue, long readTime) Description copied from class:AbstractIdentityMapCreate the correct type of CacheKey for this map.- Overrides:
createCacheKeyin classAbstractIdentityMap
-
acquireDeferredLock
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireDeferredLockin interfaceIdentityMap- Overrides:
acquireDeferredLockin classAbstractIdentityMap
-
acquireLock
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireLockin interfaceIdentityMap- Overrides:
acquireLockin classAbstractIdentityMap
-
acquireLockNoWait
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireLockNoWaitin interfaceIdentityMap- Overrides:
acquireLockNoWaitin classAbstractIdentityMap
-
acquireLockWithWait
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireLockWithWaitin interfaceIdentityMap- Overrides:
acquireLockWithWaitin classAbstractIdentityMap
-
acquireReadLockOnCacheKey
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireReadLockOnCacheKeyin interfaceIdentityMap- Overrides:
acquireReadLockOnCacheKeyin classAbstractIdentityMap
-
acquireReadLockOnCacheKeyNoWait
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireReadLockOnCacheKeyNoWaitin interfaceIdentityMap- Overrides:
acquireReadLockOnCacheKeyNoWaitin classAbstractIdentityMap
-
getCacheKeyWithReadLock
Avoid acquiring any lock as uow is single threaded.- Overrides:
getCacheKeyWithReadLockin classAbstractIdentityMap
-
putCacheKeyIfAbsent
Use hashmap put, as no concurrency in unit of work.- Overrides:
putCacheKeyIfAbsentin classFullIdentityMap
-
remove
Avoid acquiring any lock as uow is single threaded.- Specified by:
removein interfaceIdentityMap- Overrides:
removein classFullIdentityMap- Returns:
- the object held within the CacheKey or null if no object cached for given cacheKey.
-
resetCacheKey
Avoid acquiring any lock as uow is single threaded.- Overrides:
resetCacheKeyin classFullIdentityMap
-
setWriteLockValue
Avoid acquiring any lock as uow is single threaded.- Specified by:
setWriteLockValuein interfaceIdentityMap- Overrides:
setWriteLockValuein classAbstractIdentityMap
-