Class IdentityMapAccessor
- java.lang.Object
-
- org.eclipse.persistence.internal.sessions.IdentityMapAccessor
-
- All Implemented Interfaces:
java.io.Serializable,IdentityMapAccessor
- Direct Known Subclasses:
ClientSessionIdentityMapAccessor,DistributedSessionIdentityMapAccessor,IsolatedClientSessionIdentityMapAccessor,SessionBrokerIdentityMapAccessor,UnitOfWorkIdentityMapAccessor
public class IdentityMapAccessor extends java.lang.Object implements IdentityMapAccessor, java.io.Serializable
INTERNAL: Internal subclass that provides access to identity maps through the session. Implements the IdentityMapAccessor interface which provides all publicly available identity map functionality to users. This is the main class that should be used to access identity maps. In general, any function that accesses the identity map manager should go through this class Any session specific functionality appears in subclasses- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected IdentityMapManageridentityMapManagerThis is the identity map manager for this accessor.protected AbstractSessionsession
-
Constructor Summary
Constructors Constructor Description IdentityMapAccessor()INTERNAL:IdentityMapAccessor(AbstractSession session)INTERNAL: An IdentityMapAccessor sits between the session and the identityMapManager It needs references in both directions.IdentityMapAccessor(AbstractSession session, IdentityMapManager identityMapManager)INTERNAL: An IdentityMapAccessor sits between the session and the identityMapManager It needs references in both directions.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CacheKeyacquireDeferredLock(java.lang.Object primarKey, java.lang.Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete)INTERNAL: Deferred lock the identity map for the object, this is used for avoiding deadlock The return cacheKey should be used to release the deferred lock.CacheKeyacquireLock(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor, boolean isCacheCheckComplete)INTERNAL: Provides access for setting a concurrency lock on an object in the IdentityMap.CacheKeyacquireLock(java.lang.Object primarKey, java.lang.Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete)INTERNAL: Lock the identity map for the object, this must be done when building objects.CacheKeyacquireLockNoWait(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor)INTERNAL: Provides access for setting a concurrency lock on an object in the IdentityMap.CacheKeyacquireLockWithWait(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor, int wait)INTERNAL: Provides access for setting a concurrency lock on an object in the IdentityMap.CacheKeyacquireReadLockOnCacheKey(java.lang.Object primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)INTERNAL: Find the cachekey for the provided primary key and place a readlock on it.CacheKeyacquireReadLockOnCacheKeyNoWait(java.lang.Object primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)INTERNAL: Find the cachekey for the provided primary key and place a readlock on it.booleanacquireWriteLock()INTERNAL: Lock the entire cache if the cache isolation requires.voidclearQueryCache()ADVANCED: Clear all the query cachesvoidclearQueryCache(java.lang.String sessionQueryName)ADVANCED: Clear the query cache associated with the named query on the sessionvoidclearQueryCache(java.lang.String descriptorQueryName, java.lang.Class queryClass)ADVANCED: Clear the query cache associated with the named query on the descriptor for the given classvoidclearQueryCache(ReadQuery query)ADVANCED: Clear the query class associated with the passed-in read querybooleancontainsObjectInIdentityMap(java.lang.Object object)ADVANCED: Return if their is an object for the primary key.booleancontainsObjectInIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Return if their is an object for the primary key.booleancontainsObjectInIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)INTERNAL: Return if their is an object for the primary key.booleancontainsObjectInIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.booleancontainsObjectInIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass)ADVANCED: Return if their is an object for the row containing primary key and the class.protected java.lang.ObjectextractPrimaryKeyFromRow(Record rowContainingPrimaryKey, java.lang.Class theClass)INTERNAL: Extract primary key from a row.java.util.Map<java.lang.Object,CacheKey>getAllCacheKeysFromIdentityMapWithEntityPK(java.lang.Object[] pkList, ClassDescriptor descriptor)ADVANCED: Using a list of Entity PK this method will attempt to bulk load the entire list from the cache.java.util.VectorgetAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow)ADVANCED: Query the cache in-memory.java.util.VectorgetAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy)ADVANCED: Query the cache in-memory.java.util.VectorgetAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean shouldReturnInvalidatedObjects)ADVANCED: Query the cache in-memory.java.util.VectorgetAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy)ADVANCED: Query the cache in-memory.java.util.VectorgetAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean shouldReturnInvalidatedObjects)ADVANCED: Query the cache in-memory.java.util.Map<java.lang.Object,java.lang.Object>getAllFromIdentityMapWithEntityPK(java.lang.Object[] pkList, ClassDescriptor descriptor)ADVANCED: Using a list of Entity PK this method will attempt to bulk load the entire list from the cache.CacheKeygetCacheKeyByIndex(CacheIndex index, CacheId indexValues, boolean shouldCheckExpiry, ClassDescriptor descriptor)Return the cache key for the cache index or null if not found.CacheKeygetCacheKeyForObject(java.lang.Object object)INTERNAL: Retrieve the cache key for the given object.CacheKeygetCacheKeyForObject(java.lang.Object primaryKey, java.lang.Class myClass, ClassDescriptor descriptor, boolean forMerge)INTERNAL: Retrieve the cache key for the given identity information.CacheKeygetCacheKeyForObject(java.lang.Object object, ClassDescriptor descriptor)INTERNAL: Retrieve the cache key for the given object from the identity maps.CacheKeygetCacheKeyForObjectForLock(java.lang.Object primaryKey, java.lang.Class myClass, ClassDescriptor descriptor)INTERNAL: Retrieve the cache key for the given identity information.java.util.VectorgetClassesRegistered()INTERNAL: This method is used to get a list of those classes with IdentityMaps in the Session.java.lang.ObjectgetFromIdentityMap(java.lang.Object object)ADVANCED: Return the object from the identity with primary and class of the given object.java.lang.ObjectgetFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)ADVANCED: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)ADVANCED: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMap(java.lang.Object primaryKey, java.lang.Object object, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.java.lang.ObjectgetFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)Deprecated.java.lang.ObjectgetFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow)ADVANCED: Query the cache in-memory.java.lang.ObjectgetFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy)ADVANCED: Query the cache in-memory.java.lang.ObjectgetFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming)INTERNAL: Query the cache in-memory.java.lang.ObjectgetFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming, boolean shouldReturnInvalidatedObjects)INTERNAL: Query the cache in-memory.java.lang.ObjectgetFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Query the cache in-memory.java.lang.ObjectgetFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy)ADVANCED: Query the cache in-memory.java.lang.ObjectgetFromIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass)ADVANCED: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)ADVANCED: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the identity with the primary and class.java.lang.ObjectgetFromIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)INTERNAL: Return the object from the identity with the primary and class.java.lang.ObjectgetFromLocalIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the local identity map with the primary and class.java.lang.ObjectgetFromLocalIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the local identity map with the primary and class.IdentityMapgetIdentityMap(java.lang.Class theClass)INTERNAL: (public to allow test cases to check) Return the identity map for the class, if missing create a new one.IdentityMapgetIdentityMap(ClassDescriptor descriptor)INTERNAL: Get the identity map for the given class from the IdentityMapManagerIdentityMapgetIdentityMap(ClassDescriptor descriptor, boolean returnNullIfMissing)INTERNAL: Get the identity map for the given class from the IdentityMapManagerIdentityMapManagergetIdentityMapManager()INTERNAL: Get the IdentityMapManager for this IdentityMapAccessor This method should be used for all IdentityMapManager access since it may be overridden in sub classes.java.lang.ObjectgetQueryResult(ReadQuery query, java.util.List parameters, boolean checkExpiry)INTERNAL: Get the cached results associated with a query.longgetRemainingValidTime(java.lang.Object object)ADVANCED: Return the remaining life of this object.AbstractSessiongetSession()INTERNAL: get the session associated with this IdentityMapAccessorjava.lang.ObjectgetWrapper(java.lang.Object primaryKey, java.lang.Class theClass)INTERNAL: Get the wrapper object from the cache key associated with the given primary key, this is used for EJB.WriteLockManagergetWriteLockManager()INTERNAL: Returns the single write Lock manager for this sessionjava.lang.ObjectgetWriteLockValue(java.lang.Object object)ADVANCED: Extract the write lock value from the identity map.java.lang.ObjectgetWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Extract the write lock value from the identity map.java.lang.ObjectgetWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)ADVANCED: Extract the write lock value from the identity map.java.lang.ObjectgetWriteLockValue(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.voidinitializeAllIdentityMaps()PUBLIC: Reset the entire object cache.voidinitializeIdentityMap(java.lang.Class theClass)PUBLIC: Reset the identity map for only the instances of the class.voidinitializeIdentityMaps()PUBLIC: Reset the entire local object cache.CacheKeyinternalPutInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue, long readTime, ClassDescriptor descriptor)INTERNAL: Register the object with the cache.voidinvalidateAll()ADVANCED: Set all of the objects from all identity maps to be invalid in the cache.voidinvalidateClass(java.lang.Class myClass)ADVANCED: Set all of the objects of a specific class to be invalid in the cache.voidinvalidateClass(java.lang.Class myClass, boolean recurseAndInvalidateToParentRoot)ADVANCED: Set all of the objects of a specific class to be invalid in the cache.voidinvalidateObject(java.lang.Object object)ADVANCED: Set an object to be invalid in the cache.voidinvalidateObject(java.lang.Object object, boolean invalidateCluster)ADVANCED: Set an object to be invalid in the cache.voidinvalidateObject(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Set an object to be invalid in the cache.voidinvalidateObject(java.lang.Object primaryKey, java.lang.Class theClass, boolean invalidateCluster)ADVANCED: Set an object to be invalid in the cache.voidinvalidateObject(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.voidinvalidateObject(java.util.Vector primaryKey, java.lang.Class theClass, boolean invalidateCluster)Deprecated.voidinvalidateObject(Record rowContainingPrimaryKey, java.lang.Class theClass)ADVANCED: Set an object to be invalid in the cache.voidinvalidateObject(Record rowContainingPrimaryKey, java.lang.Class theClass, boolean invalidateCluster)ADVANCED: Set an object to be invalid in the cache.voidinvalidateObjects(java.util.Collection collection)ADVANCED: Set all of the objects in the given collection to be invalid in the cache.voidinvalidateObjects(java.util.Collection collection, boolean invalidateCluster)ADVANCED: Set all of the objects in the given collection to be invalid in the cache.voidinvalidateObjects(Expression selectionCriteria)ADVANCED: Set all of the objects from the given Expression to be invalid in the cache.voidinvalidateObjects(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, boolean shouldInvalidateOnException)ADVANCED: Queries the cache in-memory with the passed in criteria and invalidates matching Objects.voidinvalidateQueryCache(java.lang.Class classThatChanged)Invalidate/remove any results for the class from the query cache.booleanisValid(java.lang.Object object)ADVANCED: Return if this object is valid in the cache.booleanisValid(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Return if this object is valid in the cache.booleanisValid(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.booleanisValid(Record rowContainingPrimaryKey, java.lang.Class theClass)ADVANCED: Return if this object is valid in the cache.java.lang.ObjectprimaryKeyFromVector(java.util.Vector primaryKeyVector)Convert the primary key Vector into a primary key object.voidprintIdentityMap(java.lang.Class businessClass)PUBLIC: Used to print all the objects in the identity map of the passed in class.voidprintIdentityMapLocks()PUBLIC: Used to print all the locks in every identity map in this session.voidprintIdentityMaps()PUBLIC: Used to print all the objects in every identity map in this session.voidputCacheKeyByIndex(CacheIndex index, CacheId indexValues, CacheKey cacheKey, ClassDescriptor descriptor)Index the cache key by the index values.java.lang.ObjectputInIdentityMap(java.lang.Object object)ADVANCED: Register the object with the cache.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.lang.Object key)ADVANCED: Register the object with the cache.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue)ADVANCED: Register the object with the cache.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue, long readTime)ADVANCED: Register the object with the cache.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue, long readTime, ClassDescriptor descriptor)ADVANCED: Register the object with the cache.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.util.Vector key)Deprecated.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.util.Vector key, java.lang.Object writeLockValue)Deprecated.java.lang.ObjectputInIdentityMap(java.lang.Object object, java.util.Vector key, java.lang.Object writeLockValue, long readTime)Deprecated.voidputQueryResult(ReadQuery query, java.util.List parameters, java.lang.Object results)INTERNAL: Set the results for a query.voidreleaseWriteLock()INTERNAL: Lock the entire cache if the cache isolation requires.java.lang.ObjectremoveFromIdentityMap(java.lang.Object object)ADVANCED: Remove the object from the object cache.java.lang.ObjectremoveFromIdentityMap(java.lang.Object key, java.lang.Class theClass)ADVANCED: Remove the object from the object cache.java.lang.ObjectremoveFromIdentityMap(java.lang.Object key, java.lang.Class theClass, ClassDescriptor descriptor, java.lang.Object object)INTERNAL: Remove the object from the object cache.java.lang.ObjectremoveFromIdentityMap(java.util.Vector key, java.lang.Class theClass)Deprecated.voidsetIdentityMapManager(IdentityMapManager identityMapManager)INTERNAL: Set the IdentityMapManager for this IdentityMapAccessorvoidsetWrapper(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object wrapper)INTERNAL: Update the wrapper object the cache key associated with the given primary key, this is used for EJB.voidupdateWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)ADVANCED: Update the write lock value in the cache.voidupdateWriteLockValue(java.lang.Object object, java.lang.Object writeLockValue)ADVANCED: Update the write lock value in the cache.voidupdateWriteLockValue(java.util.Vector primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)Deprecated.voidvalidateCache()INTERNAL: This can be used to help debugging an object identity problem.
-
-
-
Field Detail
-
identityMapManager
protected IdentityMapManager identityMapManager
This is the identity map manager for this accessor. It should only be accessed through the getter
-
session
protected AbstractSession session
-
-
Constructor Detail
-
IdentityMapAccessor
public IdentityMapAccessor()
INTERNAL:
-
IdentityMapAccessor
public IdentityMapAccessor(AbstractSession session)
INTERNAL: An IdentityMapAccessor sits between the session and the identityMapManager It needs references in both directions.
-
IdentityMapAccessor
public IdentityMapAccessor(AbstractSession session, IdentityMapManager identityMapManager)
INTERNAL: An IdentityMapAccessor sits between the session and the identityMapManager It needs references in both directions.
-
-
Method Detail
-
acquireDeferredLock
public CacheKey acquireDeferredLock(java.lang.Object primarKey, java.lang.Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete)
INTERNAL: Deferred lock the identity map for the object, this is used for avoiding deadlock The return cacheKey should be used to release the deferred lock.
-
acquireLock
public CacheKey acquireLock(java.lang.Object primarKey, java.lang.Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete)
INTERNAL: Lock the identity map for the object, this must be done when building objects. The return cacheKey should be used to release the lock.
-
acquireLock
public CacheKey acquireLock(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor, boolean isCacheCheckComplete)
INTERNAL: Provides access for setting a concurrency lock on an object in the IdentityMap. Called with true from the merge process, if true then the refresh will not refresh the object.
-
acquireLockNoWait
public CacheKey acquireLockNoWait(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor)
INTERNAL: Provides access for setting a concurrency lock on an object in the IdentityMap. Called with true from the merge process, if true then the refresh will not refresh the object.
-
acquireLockWithWait
public CacheKey acquireLockWithWait(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor, int wait)
INTERNAL: Provides access for setting a concurrency lock on an object in the IdentityMap. Called with true from the merge process, if true then the refresh will not refresh the object.
-
acquireReadLockOnCacheKey
public CacheKey acquireReadLockOnCacheKey(java.lang.Object primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)
INTERNAL: Find the cachekey for the provided primary key and place a readlock on it. This will allow multiple users to read the same object but prevent writes to the object while the read lock is held.
-
acquireReadLockOnCacheKeyNoWait
public CacheKey acquireReadLockOnCacheKeyNoWait(java.lang.Object primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)
INTERNAL: Find the cachekey for the provided primary key and place a readlock on it. This will allow multiple users to read the same object but prevent writes to the object while the read lock is held. If no readlock can be acquired then do not wait but return null.
-
acquireWriteLock
public boolean acquireWriteLock()
INTERNAL: Lock the entire cache if the cache isolation requires. By default concurrent reads and writes are allowed. By write, unit of work merge is meant.
-
clearQueryCache
public void clearQueryCache()
ADVANCED: Clear all the query caches- Specified by:
clearQueryCachein interfaceIdentityMapAccessor
-
clearQueryCache
public void clearQueryCache(ReadQuery query)
ADVANCED: Clear the query class associated with the passed-in read query- Specified by:
clearQueryCachein interfaceIdentityMapAccessor
-
clearQueryCache
public void clearQueryCache(java.lang.String sessionQueryName)
ADVANCED: Clear the query cache associated with the named query on the session- Specified by:
clearQueryCachein interfaceIdentityMapAccessor
-
clearQueryCache
public void clearQueryCache(java.lang.String descriptorQueryName, java.lang.Class queryClass)ADVANCED: Clear the query cache associated with the named query on the descriptor for the given class- Specified by:
clearQueryCachein interfaceIdentityMapAccessor
-
containsObjectInIdentityMap
public boolean containsObjectInIdentityMap(java.lang.Object object)
ADVANCED: Return if their is an object for the primary key.- Specified by:
containsObjectInIdentityMapin interfaceIdentityMapAccessor
-
primaryKeyFromVector
public java.lang.Object primaryKeyFromVector(java.util.Vector primaryKeyVector)
Convert the primary key Vector into a primary key object. This is used to support the old deprecated Vector API.
-
containsObjectInIdentityMap
@Deprecated public boolean containsObjectInIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.ADVANCED: Return if their is an object for the primary key.- Specified by:
containsObjectInIdentityMapin interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.containsObjectInIdentityMap(Object, Class)
-
containsObjectInIdentityMap
public boolean containsObjectInIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Return if their is an object for the primary key.- Specified by:
containsObjectInIdentityMapin interfaceIdentityMapAccessor
-
containsObjectInIdentityMap
public boolean containsObjectInIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)INTERNAL: Return if their is an object for the primary key.
-
containsObjectInIdentityMap
public boolean containsObjectInIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass)
ADVANCED: Return if their is an object for the row containing primary key and the class.- Specified by:
containsObjectInIdentityMapin interfaceIdentityMapAccessor
-
extractPrimaryKeyFromRow
protected java.lang.Object extractPrimaryKeyFromRow(Record rowContainingPrimaryKey, java.lang.Class theClass)
INTERNAL: Extract primary key from a row.
-
getCacheKeyForObject
public CacheKey getCacheKeyForObject(java.lang.Object object, ClassDescriptor descriptor)
INTERNAL: Retrieve the cache key for the given object from the identity maps.- Parameters:
object- the object to get the cache key for.
-
getClassesRegistered
public java.util.Vector getClassesRegistered()
INTERNAL: This method is used to get a list of those classes with IdentityMaps in the Session.
-
getAllFromIdentityMap
public java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow) throws QueryException
ADVANCED: Query the cache in-memory. If the expression is too complex an exception will be thrown.- Throws:
QueryException
-
getAllFromIdentityMap
public java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy) throws QueryException
ADVANCED: Query the cache in-memory. If the expression is too complex an exception will be thrown.- Specified by:
getAllFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- Expression selecting the Objects to be returnedtheClass- Class to be consideredtranslationRow- RecordvalueHolderPolicy- seeInMemoryQueryIndirectionPolicy- Returns:
- Vector of Objects with type theClass and matching the selectionCriteria
- Throws:
QueryException
-
getAllFromIdentityMap
public java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy) throws QueryException
ADVANCED: Query the cache in-memory. If the expression is too complex an exception will be thrown.- Specified by:
getAllFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- Expression selecting the Objects to be returnedtheClass- Class to be consideredtranslationRow- RecordvalueHolderPolicy- seeInMemoryQueryIndirectionPolicy- Returns:
- Vector of Objects with type theClass and matching the selectionCriteria
- Throws:
QueryException
-
getAllFromIdentityMap
public java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean shouldReturnInvalidatedObjects) throws QueryException
ADVANCED: Query the cache in-memory. If the expression is too complex an exception will be thrown. Only return objects that are invalid in the cache if specified.- Specified by:
getAllFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- Expression selecting the Objects to be returnedtheClass- Class to be consideredtranslationRow- RecordvalueHolderPolicy- seeInMemoryQueryIndirectionPolicyshouldReturnInvalidatedObjects- boolean - true if only invalid Objects should be returned- Returns:
- Vector of Objects
- Throws:
QueryException
-
getAllFromIdentityMap
public java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean shouldReturnInvalidatedObjects) throws QueryException
ADVANCED: Query the cache in-memory. If the expression is too complex an exception will be thrown. Only return objects that are invalid in the cache if specified.- Specified by:
getAllFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- Expression selecting the Objects to be returnedtheClass- Class to be consideredtranslationRow- RecordvalueHolderPolicy- seeInMemoryQueryIndirectionPolicyshouldReturnInvalidatedObjects- boolean - true if only invalid Objects should be returned- Returns:
- Vector of Objects
- Throws:
QueryException
-
getAllFromIdentityMapWithEntityPK
public java.util.Map<java.lang.Object,java.lang.Object> getAllFromIdentityMapWithEntityPK(java.lang.Object[] pkList, ClassDescriptor descriptor)ADVANCED: Using a list of Entity PK this method will attempt to bulk load the entire list from the cache. In certain circumstances this can have large performance improvements over loading each item individually.- Parameters:
pkList- List of Entity PKs to extract from the cacheClassDescriptor- Descriptor type to be retrieved.- Returns:
- Map of Entity PKs associated to the Entities that were retrieved
- Throws:
QueryException
-
getAllCacheKeysFromIdentityMapWithEntityPK
public java.util.Map<java.lang.Object,CacheKey> getAllCacheKeysFromIdentityMapWithEntityPK(java.lang.Object[] pkList, ClassDescriptor descriptor)
ADVANCED: Using a list of Entity PK this method will attempt to bulk load the entire list from the cache. In certain circumstances this can have large performance improvements over loading each item individually.- Parameters:
pkList- List of Entity PKs to extract from the cacheClassDescriptor- Descriptor type to be retrieved.- Returns:
- Map of Entity PKs associated to the Entities that were retrieved
- Throws:
QueryException
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(java.lang.Object object)
ADVANCED: Return the object from the identity with primary and class of the given object.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
object- Object- Returns:
- Object from identity map, may be null.
-
getCacheKeyForObject
public CacheKey getCacheKeyForObject(java.lang.Object object)
INTERNAL: Retrieve the cache key for the given object.- Returns:
- CacheKey
-
getCacheKeyForObjectForLock
public CacheKey getCacheKeyForObjectForLock(java.lang.Object primaryKey, java.lang.Class myClass, ClassDescriptor descriptor)
INTERNAL: Retrieve the cache key for the given identity information.- Parameters:
primaryKey- the primary key of the cache key to be retrieved.myClass- the class of the cache key to be retrieved.
-
getCacheKeyForObject
public CacheKey getCacheKeyForObject(java.lang.Object primaryKey, java.lang.Class myClass, ClassDescriptor descriptor, boolean forMerge)
INTERNAL: Retrieve the cache key for the given identity information.- Parameters:
primaryKey- the primary key of the cache key to be retrieved.myClass- the class of the cache key to be retrieved.
-
getFromIdentityMap
@Deprecated public java.lang.Object getFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.ADVANCED: Return the object from the identity with the primary and class.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Returns:
- Object from identity map, may be null.
- See Also:
IdentityMapAccessor.getFromIdentityMap(Object, Class)
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Return the object from the identity with the primary and class.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Returns:
- Object from identity map, may be null.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)ADVANCED: Return the object from the identity with the primary and class.
-
getFromIdentityMap
@Deprecated public java.lang.Object getFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)Deprecated.ADVANCED: Return the object from the identity with the primary and class. Only return invalidated objects if requested.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Returns:
- Object from identity map, may be null.
- See Also:
IdentityMapAccessor.getFromIdentityMap(Object, Class, boolean)
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)ADVANCED: Return the object from the identity with the primary and class. Only return invalidated objects if requested.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Returns:
- Object from identity map, may be null.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Object object, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the identity with the primary and class. Only return invalidated objects if requested.
-
getFromLocalIdentityMap
public java.lang.Object getFromLocalIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the local identity map with the primary and class. This avoids checking the parent cache for the unit of work.
-
getFromLocalIdentityMapWithDeferredLock
public java.lang.Object getFromLocalIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the local identity map with the primary and class. This avoids checking the parent cache for the unit of work.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass)
ADVANCED: Return the object from the identity with the primary and class.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
rowContainingPrimaryKey- RecordtheClass- Class- Returns:
- Object from identity map, may be null.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)
ADVANCED: Return the object from the identity with the primary and class. Only return invalidated objects if requested.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
rowContainingPrimaryKey- RecordtheClass- ClassshouldReturnInvalidatedObjects- boolean- Returns:
- Object from identity map, may be null.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow) throws QueryException
ADVANCED: Query the cache in-memory. If the object is not found null is returned. If the expression is too complex an exception will be thrown.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- ExpressiontheClass- ClasstranslationRow- Record- Returns:
- Object from identity map, may be null
- Throws:
QueryException
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy) throws QueryException
ADVANCED: Query the cache in-memory. If the object is not found null is returned. If the expression is too complex an exception will be thrown.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- ExpressiontheClass- ClasstranslationRow- RecordvalueHolderPolicy- seeInMemoryQueryIndirectionPolicy- Returns:
- Object from identity map, may be null
- Throws:
QueryException
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy) throws QueryException
ADVANCED: Query the cache in-memory. If the object is not found null is returned. If the expression is too complex an exception will be thrown.- Specified by:
getFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- ExpressiontheClass- ClasstranslationRow- RecordvalueHolderPolicy- seeInMemoryQueryIndirectionPolicy- Returns:
- Object from identity map, may be null
- Throws:
QueryException
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming)
INTERNAL: Query the cache in-memory. If the object is not found null is returned. If the expression is too complex an exception will be thrown.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming, boolean shouldReturnInvalidatedObjects)
INTERNAL: Query the cache in-memory. If the object is not found null is returned. If the expression is too complex an exception will be thrown.
-
getFromIdentityMap
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)
INTERNAL: Query the cache in-memory. If the object is not found null is returned. If the expression is too complex an exception will be thrown.
-
getFromIdentityMapWithDeferredLock
public java.lang.Object getFromIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)INTERNAL: Return the object from the identity with the primary and class.
-
getFromIdentityMapWithDeferredLock
public java.lang.Object getFromIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)INTERNAL: Return the object from the identity with the primary and class. Only return invalidated objects if requested
-
getIdentityMapManager
public IdentityMapManager getIdentityMapManager()
INTERNAL: Get the IdentityMapManager for this IdentityMapAccessor This method should be used for all IdentityMapManager access since it may be overridden in sub classes.
-
getIdentityMap
public IdentityMap getIdentityMap(java.lang.Class theClass)
INTERNAL: (public to allow test cases to check) Return the identity map for the class, if missing create a new one.
-
getIdentityMap
public IdentityMap getIdentityMap(ClassDescriptor descriptor)
INTERNAL: Get the identity map for the given class from the IdentityMapManager
-
getIdentityMap
public IdentityMap getIdentityMap(ClassDescriptor descriptor, boolean returnNullIfMissing)
INTERNAL: Get the identity map for the given class from the IdentityMapManager
-
getQueryResult
public java.lang.Object getQueryResult(ReadQuery query, java.util.List parameters, boolean checkExpiry)
INTERNAL: Get the cached results associated with a query. Results are cached by the values of the parameters to the query so different parameters will have different cached results.
-
getRemainingValidTime
public long getRemainingValidTime(java.lang.Object object)
ADVANCED: Return the remaining life of this object. This method is associated with use of cache invalidation and returns the difference between the next expiry time of the object and its read time. The method will return 0 for invalidated objects.- Specified by:
getRemainingValidTimein interfaceIdentityMapAccessor- Parameters:
object- Object under consideration- Returns:
- long time in milliseconds
-
getSession
public AbstractSession getSession()
INTERNAL: get the session associated with this IdentityMapAccessor
-
getWrapper
public java.lang.Object getWrapper(java.lang.Object primaryKey, java.lang.Class theClass)INTERNAL: Get the wrapper object from the cache key associated with the given primary key, this is used for EJB.
-
getWriteLockManager
public WriteLockManager getWriteLockManager()
INTERNAL: Returns the single write Lock manager for this session
-
getWriteLockValue
public java.lang.Object getWriteLockValue(java.lang.Object object)
ADVANCED: Extract the write lock value from the identity map.- Specified by:
getWriteLockValuein interfaceIdentityMapAccessor- Parameters:
object- Object- Returns:
- Object for versioning
-
getWriteLockValue
@Deprecated public java.lang.Object getWriteLockValue(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.ADVANCED: Extract the write lock value from the identity map.- Specified by:
getWriteLockValuein interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.getWriteLockValue(Object, Class)
-
getWriteLockValue
public java.lang.Object getWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Extract the write lock value from the identity map.- Specified by:
getWriteLockValuein interfaceIdentityMapAccessor
-
getWriteLockValue
public java.lang.Object getWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)ADVANCED: Extract the write lock value from the identity map.
-
initializeAllIdentityMaps
public void initializeAllIdentityMaps()
PUBLIC: Reset the entire object cache.NOTE: be careful using this method. This method blows away both this session's and its parents caches, this includes the server cache or any other cache. This throws away any objects that have been read in. Extreme caution should be used before doing this because object identity will no longer be maintained for any objects currently read in. This should only be called if the application knows that it no longer has references to object held in the cache.
- Specified by:
initializeAllIdentityMapsin interfaceIdentityMapAccessor
-
initializeIdentityMap
public void initializeIdentityMap(java.lang.Class theClass)
PUBLIC: Reset the identity map for only the instances of the class. For inheritance the user must make sure that they only use the root class. Caution must be used in doing this to ensure that the objects within the identity map are not referenced from other objects of other classes or from the application.- Specified by:
initializeIdentityMapin interfaceIdentityMapAccessor- Parameters:
theClass- Class
-
initializeIdentityMaps
public void initializeIdentityMaps()
PUBLIC: Reset the entire local object cache. This throws away any objects that have been read in. Extreme caution should be used before doing this because object identity will no longer be maintained for any objects currently read in. This should only be called if the application knows that it no longer has references to object held in the cache.- Specified by:
initializeIdentityMapsin interfaceIdentityMapAccessor
-
invalidateObject
public void invalidateObject(java.lang.Object object)
ADVANCED: Set an object to be invalid in the cache. If the object does not exist in the cache, this method will return without any action.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor- Parameters:
object- Object
-
invalidateObject
public void invalidateObject(java.lang.Object object, boolean invalidateCluster)ADVANCED: Set an object to be invalid in the cache.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor- Parameters:
invalidateCluster- if true the invalidation will be broadcast to each server in the cluster.
-
invalidateObject
@Deprecated public void invalidateObject(java.util.Vector primaryKey, java.lang.Class theClass, boolean invalidateCluster)Deprecated.ADVANCED: Set an object to be invalid in the cache. If the object does not exist in the cache, this method will return without any action.- Specified by:
invalidateObjectin interfaceIdentityMapAccessorinvalidateCluster- if true the invalidation will be broadcast to each server in the cluster.- See Also:
IdentityMapAccessor.invalidateObject(Object, Class, boolean)
-
invalidateObject
@Deprecated public void invalidateObject(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.ADVANCED: Set an object to be invalid in the cache. If the object does not exist in the cache, this method will return without any action.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.invalidateObject(Object, Class)
-
invalidateObject
public void invalidateObject(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Set an object to be invalid in the cache. If the object does not exist in the cache, this method will return without any action.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor
-
invalidateObject
public void invalidateObject(java.lang.Object primaryKey, java.lang.Class theClass, boolean invalidateCluster)ADVANCED: Set an object to be invalid in the cache.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor- Parameters:
invalidateCluster- if true the invalidation will be broadcast to each server in the cluster.
-
invalidateObject
public void invalidateObject(Record rowContainingPrimaryKey, java.lang.Class theClass)
ADVANCED: Set an object to be invalid in the cache. If the object does not exist in the cache, this method will return without any action.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor
-
invalidateObject
public void invalidateObject(Record rowContainingPrimaryKey, java.lang.Class theClass, boolean invalidateCluster)
ADVANCED: Set an object to be invalid in the cache.- Specified by:
invalidateObjectin interfaceIdentityMapAccessor- Parameters:
invalidateCluster- if true the invalidation will be broadcast to each server in the cluster.
-
invalidateObjects
public void invalidateObjects(Expression selectionCriteria)
ADVANCED: Set all of the objects from the given Expression to be invalid in the cache.- Specified by:
invalidateObjectsin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- Expression
-
invalidateObjects
public void invalidateObjects(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, boolean shouldInvalidateOnException)
ADVANCED: Queries the cache in-memory with the passed in criteria and invalidates matching Objects. If the expression is too complex either all or none object of theClass invalidated (depending on shouldInvalidateOnException value).- Specified by:
invalidateObjectsin interfaceIdentityMapAccessor- Parameters:
selectionCriteria- Expression selecting the Objects to be returnedtheClass- Class to be consideredtranslationRow- RecordshouldInvalidateOnException- boolean indicates weather to invalidate the object if conform threw exception.
-
invalidateObjects
public void invalidateObjects(java.util.Collection collection)
ADVANCED: Set all of the objects in the given collection to be invalid in the cache. This method will take no action for any objects in the collection that do not exist in the cache.- Specified by:
invalidateObjectsin interfaceIdentityMapAccessor- Parameters:
collection- objects to be invalidated
-
invalidateObjects
public void invalidateObjects(java.util.Collection collection, boolean invalidateCluster)ADVANCED: Set all of the objects in the given collection to be invalid in the cache.- Specified by:
invalidateObjectsin interfaceIdentityMapAccessor- Parameters:
invalidateCluster- if true the invalidation will be broadcast to each server in the cluster.
-
invalidateClass
public void invalidateClass(java.lang.Class myClass)
ADVANCED: Set all of the objects of a specific class to be invalid in the cache. Will set the recurseAndInvalidateToParentRoot flag on inheritance to true.- Specified by:
invalidateClassin interfaceIdentityMapAccessor
-
invalidateClass
public void invalidateClass(java.lang.Class myClass, boolean recurseAndInvalidateToParentRoot)ADVANCED: Set all of the objects of a specific class to be invalid in the cache. User can set the recurse flag to false if they do not want to invalidate all the classes within an inheritance tree and instead invalidate the subtree rooted at myClass.- Specified by:
invalidateClassin interfaceIdentityMapAccessor- Parameters:
myClass- - the class where we start invalidationrecurseAndInvalidateToParentRoot- - default is true where we invalidate up the inheritance tree to the root descriptor
-
invalidateQueryCache
public void invalidateQueryCache(java.lang.Class classThatChanged)
Invalidate/remove any results for the class from the query cache. This is used to invalidate the query cache on any change.- Specified by:
invalidateQueryCachein interfaceIdentityMapAccessor
-
invalidateAll
public void invalidateAll()
ADVANCED: Set all of the objects from all identity maps to be invalid in the cache.- Specified by:
invalidateAllin interfaceIdentityMapAccessor
-
isValid
public boolean isValid(java.lang.Object object)
ADVANCED: Return if this object is valid in the cache.- Specified by:
isValidin interfaceIdentityMapAccessor
-
isValid
@Deprecated public boolean isValid(java.util.Vector primaryKey, java.lang.Class theClass)Deprecated.ADVANCED: Return if this object is valid in the cache.- Specified by:
isValidin interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.isValid(Object, Class)
-
isValid
public boolean isValid(java.lang.Object primaryKey, java.lang.Class theClass)ADVANCED: Return if this object is valid in the cache.- Specified by:
isValidin interfaceIdentityMapAccessor
-
isValid
public boolean isValid(Record rowContainingPrimaryKey, java.lang.Class theClass)
ADVANCED: Return if this object is valid in the cache.- Specified by:
isValidin interfaceIdentityMapAccessor
-
printIdentityMap
public void printIdentityMap(java.lang.Class businessClass)
PUBLIC: Used to print all the objects in the identity map of the passed in class. The output of this method will be logged to this session's SessionLog at SEVERE level.- Specified by:
printIdentityMapin interfaceIdentityMapAccessor
-
printIdentityMaps
public void printIdentityMaps()
PUBLIC: Used to print all the objects in every identity map in this session. The output of this method will be logged to this session's SessionLog at SEVERE level.- Specified by:
printIdentityMapsin interfaceIdentityMapAccessor
-
printIdentityMapLocks
public void printIdentityMapLocks()
PUBLIC: Used to print all the locks in every identity map in this session. The output of this method will be logged to this session's SessionLog at FINEST level.- Specified by:
printIdentityMapLocksin interfaceIdentityMapAccessor
-
putInIdentityMap
public java.lang.Object putInIdentityMap(java.lang.Object object)
ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor- Parameters:
object- Object- Returns:
- Object
-
putInIdentityMap
@Deprecated public java.lang.Object putInIdentityMap(java.lang.Object object, java.util.Vector key)Deprecated.ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.putInIdentityMap(Object, Object)
-
putInIdentityMap
public java.lang.Object putInIdentityMap(java.lang.Object object, java.lang.Object key)ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor
-
putInIdentityMap
@Deprecated public java.lang.Object putInIdentityMap(java.lang.Object object, java.util.Vector key, java.lang.Object writeLockValue)Deprecated.ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.putInIdentityMap(Object, Object, Object)
-
putInIdentityMap
public java.lang.Object putInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue)ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor
-
putInIdentityMap
@Deprecated public java.lang.Object putInIdentityMap(java.lang.Object object, java.util.Vector key, java.lang.Object writeLockValue, long readTime)Deprecated.ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used. The readTime may also be included in the cache key as it is constructed.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor- Parameters:
object- Objectkey- ObjectwriteLockValue- Object for versioningreadTime- long, time in milliseconds- Returns:
- Object the Object put into the identity map
- See Also:
IdentityMapAccessor.putInIdentityMap(Object, Object, Object, long)
-
putInIdentityMap
public java.lang.Object putInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue, long readTime)ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used. The readTime may also be included in the cache key as it is constructed.- Specified by:
putInIdentityMapin interfaceIdentityMapAccessor- Parameters:
object- Objectkey- ObjectwriteLockValue- Object for versioningreadTime- long, time in milliseconds- Returns:
- Object the Object put into the identity map
-
putInIdentityMap
public java.lang.Object putInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue, long readTime, ClassDescriptor descriptor)ADVANCED: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used. The readTime may also be included in the cache key as it is constructed.
-
putQueryResult
public void putQueryResult(ReadQuery query, java.util.List parameters, java.lang.Object results)
INTERNAL: Set the results for a query. Query results are cached based on the parameter values provided to the query different parameter values access different caches.
-
putCacheKeyByIndex
public void putCacheKeyByIndex(CacheIndex index, CacheId indexValues, CacheKey cacheKey, ClassDescriptor descriptor)
Index the cache key by the index values.
-
getCacheKeyByIndex
public CacheKey getCacheKeyByIndex(CacheIndex index, CacheId indexValues, boolean shouldCheckExpiry, ClassDescriptor descriptor)
Return the cache key for the cache index or null if not found.
-
internalPutInIdentityMap
public CacheKey internalPutInIdentityMap(java.lang.Object object, java.lang.Object key, java.lang.Object writeLockValue, long readTime, ClassDescriptor descriptor)
INTERNAL: Register the object with the cache. The object must always be registered with its version number if optimistic locking is used. The readTime may also be included in the cache key as it is constructed. Return the cache-key.
-
releaseWriteLock
public void releaseWriteLock()
INTERNAL: Lock the entire cache if the cache isolation requires. By default concurrent reads and writes are allowed. By write, unit of work merge is meant.
-
removeFromIdentityMap
public java.lang.Object removeFromIdentityMap(java.lang.Object object)
ADVANCED: Remove the object from the object cache. Caution should be used when calling to avoid violating object identity. The application should only call this is it knows that no references to the object exist.- Specified by:
removeFromIdentityMapin interfaceIdentityMapAccessor- Parameters:
object- Object- Returns:
- Object the Object removed from the identity map
-
removeFromIdentityMap
@Deprecated public java.lang.Object removeFromIdentityMap(java.util.Vector key, java.lang.Class theClass)Deprecated.ADVANCED: Remove the object from the object cache.- Specified by:
removeFromIdentityMapin interfaceIdentityMapAccessor- Returns:
- Object the Object removed from the identity map
- See Also:
IdentityMapAccessor.removeFromIdentityMap(Object, Class)
-
removeFromIdentityMap
public java.lang.Object removeFromIdentityMap(java.lang.Object key, java.lang.Class theClass)ADVANCED: Remove the object from the object cache.- Specified by:
removeFromIdentityMapin interfaceIdentityMapAccessor- Returns:
- Object the Object removed from the identity map
-
removeFromIdentityMap
public java.lang.Object removeFromIdentityMap(java.lang.Object key, java.lang.Class theClass, ClassDescriptor descriptor, java.lang.Object object)INTERNAL: Remove the object from the object cache.
-
setIdentityMapManager
public void setIdentityMapManager(IdentityMapManager identityMapManager)
INTERNAL: Set the IdentityMapManager for this IdentityMapAccessor
-
setWrapper
public void setWrapper(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object wrapper)INTERNAL: Update the wrapper object the cache key associated with the given primary key, this is used for EJB.
-
updateWriteLockValue
public void updateWriteLockValue(java.lang.Object object, java.lang.Object writeLockValue)ADVANCED: Update the write lock value in the cache.- Specified by:
updateWriteLockValuein interfaceIdentityMapAccessor- Parameters:
object- ObjectwriteLockValue- Object for versioning
-
updateWriteLockValue
@Deprecated public void updateWriteLockValue(java.util.Vector primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)Deprecated.ADVANCED: Update the write lock value in the cache.- Specified by:
updateWriteLockValuein interfaceIdentityMapAccessor- See Also:
IdentityMapAccessor.updateWriteLockValue(Object, Class, Object)
-
updateWriteLockValue
public void updateWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)ADVANCED: Update the write lock value in the cache.- Specified by:
updateWriteLockValuein interfaceIdentityMapAccessor
-
validateCache
public void validateCache()
INTERNAL: This can be used to help debugging an object identity problem. An object identity problem is when an object in the cache references an object not in the cache. This method will validate that all cached objects are in a correct state.- Specified by:
validateCachein interfaceIdentityMapAccessor
-
-