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
public class UnitOfWorkIdentityMap extends FullIdentityMap
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
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.identitymaps.FullIdentityMap
cacheKeys
-
Fields inherited from class org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
descriptor, isIsolated, maxSize, session
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnitOfWorkIdentityMap()UnitOfWorkIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheKeyacquireDeferredLock(Object primaryKey, boolean isCacheCheckComplete)Avoid acquiring any lock as uow is single threaded.CacheKeyacquireLock(Object primaryKey, boolean forMerge, boolean isCacheCheckComplete)Avoid acquiring any lock as uow is single threaded.CacheKeyacquireLockNoWait(Object primaryKey, boolean forMerge)Avoid acquiring any lock as uow is single threaded.CacheKeyacquireLockWithWait(Object primaryKey, boolean forMerge, int wait)Avoid acquiring any lock as uow is single threaded.CacheKeyacquireReadLockOnCacheKey(Object primaryKey)Avoid acquiring any lock as uow is single threaded.CacheKeyacquireReadLockOnCacheKeyNoWait(Object primaryKey)Avoid acquiring any lock as uow is single threaded.CacheKeycreateCacheKey(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.Objectremove(CacheKey cacheKey)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, setCacheKeys
-
Methods 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 Detail
-
UnitOfWorkIdentityMap
protected UnitOfWorkIdentityMap()
-
UnitOfWorkIdentityMap
public UnitOfWorkIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated)
-
-
Method Detail
-
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
public CacheKey acquireDeferredLock(Object primaryKey, boolean isCacheCheckComplete)
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireDeferredLockin interfaceIdentityMap- Overrides:
acquireDeferredLockin classAbstractIdentityMap
-
acquireLock
public CacheKey acquireLock(Object primaryKey, boolean forMerge, boolean isCacheCheckComplete)
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireLockin interfaceIdentityMap- Overrides:
acquireLockin classAbstractIdentityMap
-
acquireLockNoWait
public CacheKey acquireLockNoWait(Object primaryKey, boolean forMerge)
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireLockNoWaitin interfaceIdentityMap- Overrides:
acquireLockNoWaitin classAbstractIdentityMap
-
acquireLockWithWait
public CacheKey acquireLockWithWait(Object primaryKey, boolean forMerge, int wait)
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireLockWithWaitin interfaceIdentityMap- Overrides:
acquireLockWithWaitin classAbstractIdentityMap
-
acquireReadLockOnCacheKey
public CacheKey acquireReadLockOnCacheKey(Object primaryKey)
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireReadLockOnCacheKeyin interfaceIdentityMap- Overrides:
acquireReadLockOnCacheKeyin classAbstractIdentityMap
-
acquireReadLockOnCacheKeyNoWait
public CacheKey acquireReadLockOnCacheKeyNoWait(Object primaryKey)
Avoid acquiring any lock as uow is single threaded.- Specified by:
acquireReadLockOnCacheKeyNoWaitin interfaceIdentityMap- Overrides:
acquireReadLockOnCacheKeyNoWaitin classAbstractIdentityMap
-
getCacheKeyWithReadLock
protected CacheKey getCacheKeyWithReadLock(Object primaryKey)
Avoid acquiring any lock as uow is single threaded.- Overrides:
getCacheKeyWithReadLockin classAbstractIdentityMap
-
putCacheKeyIfAbsent
protected CacheKey putCacheKeyIfAbsent(CacheKey searchKey)
Use hashmap put, as no concurrency in unit of work.- Overrides:
putCacheKeyIfAbsentin classFullIdentityMap
-
remove
public Object remove(CacheKey cacheKey)
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
public void resetCacheKey(CacheKey key, Object object, Object writeLockValue, long readTime)
Avoid acquiring any lock as uow is single threaded.- Overrides:
resetCacheKeyin classFullIdentityMap
-
setWriteLockValue
public void setWriteLockValue(Object primaryKey, Object writeLockValue)
Avoid acquiring any lock as uow is single threaded.- Specified by:
setWriteLockValuein interfaceIdentityMap- Overrides:
setWriteLockValuein classAbstractIdentityMap
-
-