Purpose:
CachePolicy defines the cache configuration.
EclipseLink supports an integrated shared (L2) object cache.
Caching is enabled by default.
To disable caching use:
setCacheIsolation(CacheIsolationType.ISOLATED)
ClassDescriptor
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | cacheable
Entity @Cacheable annotation value. |
| protected Map | |
| protected Class | |
| protected String | |
| protected CacheIsolationType | |
| protected CacheKeyType | cacheKeyType
Allow cache key type to be configured. |
| protected int | cacheSynchronizationType
Configures how objects will be sent via cache synchronization, if synchronization is enabled. |
| protected DatabaseChangeNotificationType | databaseChangeNotificationType
Allows configuration of database change event notification. |
| public static final int | |
| protected boolean | fullyMergeEntity
This flag controls how the MergeManager should merge an Entity when merging into the shared cache. |
| protected Class | |
| protected int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| protected boolean | prefetchCacheKeys
In certain cases and cache types it is more efficient to preFetch the cache keys from the cache when building the results of the query. |
| protected Class | |
| protected int | |
| public static final int | |
| public static final int | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| public static final int | |
| public static final int | |
| protected int | unitOfWorkCacheIsolationLevel
Configures how the unit of work uses the session cache. |
| public static final int | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | addCacheIndex(DatabaseField[] fields)
PUBLIC: Add the cache index to the descriptor's cache settings. |
| public void | assignDefaultValues(AbstractSession session)
INTERNAL: Some attributes have default values defined in Project. |
| public CacheKey | checkCacheByIndex(Expression expression, AbstractRecord translationRow, ClassDescriptor descriptor, AbstractSession session)
INTERNAL: Lookup the expression in the cache if it contains any indexes. |
| public CachePolicy | |
| public void | convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this Descriptor to actual class-based settings. |
| public CacheIndex | |
| public Map | |
| public <T extends CacheInterceptor> Class | getCacheInterceptorClass()
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. |
| public String | getCacheInterceptorClassName()
A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. |
| public CacheIsolationType | Returns: the isolationTypePUBLIC: Controls how the Entity instances will be cached. |
| public CacheKeyType | |
| public int | Returns: intPUBLIC: Get a value indicating the type of cache synchronization that will be used on objects of this type. |
| public DatabaseChangeNotificationType | getDatabaseChangeNotificationType()
Returns what type of database change notification an entity/descriptor should use. |
| public boolean | |
| public <T extends IdentityMap> Class | |
| public int | |
| public <T extends IdentityMap> Class | getRemoteIdentityMapClass()
INTERNAL: Return the class of identity map to be used by this descriptor. |
| public int | |
| public int | |
| public boolean | |
| public void | indexObjectInCache(CacheKey cacheKey, AbstractRecord databaseRow, Object domainObject, ClassDescriptor descriptor, AbstractSession session, boolean refresh)
INTERNAL: Index the object by index in the cache using its row. |
| public void | indexObjectInCache(CacheKey cacheKey, Object object, ClassDescriptor descriptor, AbstractSession session, boolean refresh)
INTERNAL: Index the object by index in the cache using the object. |
| public void | indexObjectInCache(ObjectChangeSet changeSet, Object object, ClassDescriptor descriptor, AbstractSession session)
INTERNAL: Index the object by index in the cache using its changeSet. |
| public void | initialize(ClassDescriptor descriptor, AbstractSession session)
INTERNAL: Allow the inheritance properties of the descriptor to be initialized. |
| public void | initializeFromParent(CachePolicy parentPolicy, ClassDescriptor descriptor, ClassDescriptor descriptorDescriptor, AbstractSession session)
INTERNAL: Allow the inheritance properties of the descriptor to be initialized. |
| public boolean | isIndexableExpression(Expression expression, ClassDescriptor descriptor, AbstractSession session)
INTERNAL: Lookup the expression in the cache if it contains any indexes. |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | postInitialize(ClassDescriptor descriptor, AbstractSession session)
INTERNAL: Initialize the cache isolation setting. |
| public void | setCacheable(Boolean
Entity @Cacheable annotation value for current class
or cacheable)null if @Cacheable annotation is not set. Parent
values are ignored, value shall refer to current class only.INTERNAL: Set entity @Cacheable annotation value. |
| public void | setCacheCoordinationType(CacheCoordinationType type)
PUBLIC: Set the type of cache coordination that will be used on objects of this type. |
| public void | |
| public void | setCacheInterceptorClass(Class<? extends CacheInterceptor> cacheInterceptorClass)
PUBLIC: A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. |
| public void | setCacheInterceptorClassName(String cacheInterceptorClassName)
PUBLIC: A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. |
| public void | setCacheIsolation(CacheIsolationType isolationType)
PUBLIC: Controls how the Entity instances and data will be cached. |
| public void | setCacheKeyType(CacheKeyType cacheKeyType)
ADVANCED: Set what cache key type to use to store the object in the cache. |
| public void | setCacheSynchronizationType(int
int The synchronization type for this descriptor type)OBSOLETE: Set the type of cache coordination that will be used on objects of this type. |
| public void | setDatabaseChangeNotificationType(DatabaseChangeNotificationType databaseChangeNotificationType)
Configures what type of database change notification an entity/descriptor should use. |
| public void | |
| public void | setIdentityMapClass(Class<? extends IdentityMap> theIdentityMapClass)
PUBLIC: Set the class of identity map to be used by this descriptor. |
| public void | setIdentityMapSize(int identityMapSize)
PUBLIC: Set the size of the identity map to be used by this descriptor. |
| public void | |
| public void | setRemoteIdentityMapClass(Class<? extends IdentityMap> theIdentityMapClass)
PUBLIC: Set the class of identity map to be used by this descriptor. |
| public void | setRemoteIdentityMapSize(int identityMapSize)
PUBLIC: Set the size of the identity map to be used by this descriptor. |
| public void | setShouldAlwaysRefreshCache(boolean shouldAlwaysRefreshCache)
PUBLIC:
When the |
| public void | setShouldAlwaysRefreshCacheOnRemote(boolean shouldAlwaysRefreshCacheOnRemote)
PUBLIC:
When the |
| public void | setShouldDisableCacheHits(boolean shouldDisableCacheHits)
PUBLIC: Set if cache hits on primary key read object queries should be disabled. |
| public void | setShouldDisableCacheHitsOnRemote(boolean shouldDisableCacheHitsOnRemote)
PUBLIC: Set if the remote session cache hits on primary key read object queries is allowed or not. |
| public void | setShouldOnlyRefreshCacheIfNewerVersion(boolean shouldOnlyRefreshCacheIfNewerVersion)
PUBLIC:
When the
|
| public void | setUnitOfWorkCacheIsolationLevel(int unitOfWorkCacheIsolationLevel)
ADVANCED: This setting configures how the session cache will be used in a unit of work. |
| public boolean | shouldAlwaysRefreshCache()
PUBLIC:
This method returns |
| public boolean | shouldAlwaysRefreshCacheOnRemote()
PUBLIC:
This method returns |
| public boolean | shouldDisableCacheHits()
PUBLIC: Return if for cache hits on primary key read object queries to be disabled. |
| public boolean | shouldDisableCacheHitsOnRemote()
PUBLIC: Return if the remote server session cache hits on primary key read object queries is aloowed or not. |
| public boolean | shouldIsolateObjectsInUnitOfWork()
INTERNAL: Return if the unit of work should by-pass the session cache. |
| public boolean | shouldIsolateObjectsInUnitOfWorkEarlyTransaction()
INTERNAL: Return if the unit of work should by-pass the session cache after an early transaction. |
| public boolean | shouldIsolateProtectedObjectsInUnitOfWork()
INTERNAL: Return if the unit of work should by-pass the IsolatedSession cache. |
| public boolean | shouldOnlyRefreshCacheIfNewerVersion()
PUBLIC:
This method returns |
| public boolean | |
| public boolean | shouldUseSessionCacheInUnitOfWorkEarlyTransaction()
INTERNAL: Return if the unit of work should use the session cache after an early transaction. |
| public void | |
| public void | useHardCacheWeakIdentityMap()
PUBLIC: Set the class of identity map to be the hard cache weak identity map. |
| public void | |
| public void | |
| public void |
| cacheable | back to summary |
|---|---|
| private Boolean cacheable Entity @Cacheable annotation value.
This value contains Boolean value equal to annotation value or null when
no annotation was set for entity. Parent values are ignored, value refers
to current class only.
This value is set only when SharedCacheMode allows to override caching
on entity level (DISABLE_SELECTIVE or ENABLE_SELECTIVE). Default value
is | |
| cacheIndexes | back to summary |
|---|---|
| protected Map<List<DatabaseField>, CacheIndex> cacheIndexes | |
| cacheInterceptorClass | back to summary |
|---|---|
| protected Class<? extends CacheInterceptor> cacheInterceptorClass | |
| cacheInterceptorClassName | back to summary |
|---|---|
| protected String cacheInterceptorClassName | |
| cacheIsolation | back to summary |
|---|---|
| protected CacheIsolationType cacheIsolation | |
| cacheKeyType | back to summary |
|---|---|
| protected CacheKeyType cacheKeyType Allow cache key type to be configured. | |
| cacheSynchronizationType | back to summary |
|---|---|
| protected int cacheSynchronizationType Configures how objects will be sent via cache synchronization, if synchronization is enabled. | |
| databaseChangeNotificationType | back to summary |
|---|---|
| protected DatabaseChangeNotificationType databaseChangeNotificationType Allows configuration of database change event notification. | |
| DO_NOT_SEND_CHANGES | back to summary |
|---|---|
| public static final int DO_NOT_SEND_CHANGES | |
| fullyMergeEntity | back to summary |
|---|---|
| protected boolean fullyMergeEntity This flag controls how the MergeManager should merge an Entity when merging into the shared cache. | |
| identityMapClass | back to summary |
|---|---|
| protected Class<? extends IdentityMap> identityMapClass | |
| identityMapSize | back to summary |
|---|---|
| protected int identityMapSize | |
| INVALIDATE_CHANGED_OBJECTS | back to summary |
|---|---|
| public static final int INVALIDATE_CHANGED_OBJECTS | |
| ISOLATE_CACHE_AFTER_TRANSACTION | back to summary |
|---|---|
| public static final int ISOLATE_CACHE_AFTER_TRANSACTION | |
| ISOLATE_CACHE_ALWAYS | back to summary |
|---|---|
| public static final int ISOLATE_CACHE_ALWAYS | |
| ISOLATE_FROM_CLIENT_SESSION | back to summary |
|---|---|
| public static final int ISOLATE_FROM_CLIENT_SESSION | |
| ISOLATE_NEW_DATA_AFTER_TRANSACTION | back to summary |
|---|---|
| public static final int ISOLATE_NEW_DATA_AFTER_TRANSACTION | |
| prefetchCacheKeys | back to summary |
|---|---|
| protected boolean prefetchCacheKeys In certain cases and cache types it is more efficient to preFetch the cache keys from the cache when building the results of the query. Set this flag to true to prefetch the results. | |
| remoteIdentityMapClass | back to summary |
|---|---|
| protected Class<? extends IdentityMap> remoteIdentityMapClass | |
| remoteIdentityMapSize | back to summary |
|---|---|
| protected int remoteIdentityMapSize | |
| SEND_NEW_OBJECTS_WITH_CHANGES | back to summary |
|---|---|
| public static final int SEND_NEW_OBJECTS_WITH_CHANGES | |
| SEND_OBJECT_CHANGES | back to summary |
|---|---|
| public static final int SEND_OBJECT_CHANGES | |
| shouldAlwaysRefreshCache | back to summary |
|---|---|
| protected boolean shouldAlwaysRefreshCache | |
| shouldAlwaysRefreshCacheOnRemote | back to summary |
|---|---|
| protected boolean shouldAlwaysRefreshCacheOnRemote | |
| shouldDisableCacheHits | back to summary |
|---|---|
| protected boolean shouldDisableCacheHits | |
| shouldDisableCacheHitsOnRemote | back to summary |
|---|---|
| protected boolean shouldDisableCacheHitsOnRemote | |
| shouldOnlyRefreshCacheIfNewerVersion | back to summary |
|---|---|
| protected boolean shouldOnlyRefreshCacheIfNewerVersion | |
| UNDEFINED_ISOLATATION | back to summary |
|---|---|
| public static final int UNDEFINED_ISOLATATION | |
| UNDEFINED_OBJECT_CHANGE_BEHAVIOR | back to summary |
|---|---|
| public static final int UNDEFINED_OBJECT_CHANGE_BEHAVIOR | |
| unitOfWorkCacheIsolationLevel | back to summary |
|---|---|
| protected int unitOfWorkCacheIsolationLevel Configures how the unit of work uses the session cache. | |
| USE_SESSION_CACHE_AFTER_TRANSACTION | back to summary |
|---|---|
| public static final int USE_SESSION_CACHE_AFTER_TRANSACTION | |
| wasDefaultUnitOfWorkCacheIsolationLevel | back to summary |
|---|---|
| protected boolean wasDefaultUnitOfWorkCacheIsolationLevel | |
| CachePolicy | back to summary |
|---|---|
| public CachePolicy() PUBLIC: Return a new descriptor. | |
| addCacheIndex | back to summary |
|---|---|
| public void addCacheIndex(CacheIndex index) PUBLIC: Add the cache index to the descriptor's cache settings. This allows for cache hits to be obtained on non-primary key fields. The primary key is always indexed in the cache. Cache indexes are defined by their database column names. | |
| addCacheIndex | back to summary |
|---|---|
| public void addCacheIndex(String... fields) PUBLIC: Add the cache index to the descriptor's cache settings. This allows for cache hits to be obtained on non-primary key fields. The primary key is always indexed in the cache. Cache indexes are defined by their database column names. | |
| addCacheIndex | back to summary |
|---|---|
| public void addCacheIndex(DatabaseField[] fields) PUBLIC: Add the cache index to the descriptor's cache settings. This allows for cache hits to be obtained on non-primary key fields. The primary key is always indexed in the cache. Cache indexes are defined by their database column names. | |
| assignDefaultValues | back to summary |
|---|---|
| public void assignDefaultValues(AbstractSession session) INTERNAL: Some attributes have default values defined in Project. If such the value for the attribute hasn't been set then the default value is assigned. | |
| checkCacheByIndex | back to summary |
|---|---|
| public CacheKey checkCacheByIndex(Expression expression, AbstractRecord translationRow, ClassDescriptor descriptor, AbstractSession session) INTERNAL: Lookup the expression in the cache if it contains any indexes. | |
| clone | back to summary |
|---|---|
| public CachePolicy clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| convertClassNamesToClasses | back to summary |
|---|---|
| public void convertClassNamesToClasses(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this Descriptor to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes. | |
| getCacheIndex | back to summary |
|---|---|
| public CacheIndex getCacheIndex(List<DatabaseField> fields) PUBLIC: Return the cache index for the field names. | |
| getCacheIndexes | back to summary |
|---|---|
| public Map | |
| getCacheInterceptorClass | back to summary |
|---|---|
| public <T extends CacheInterceptor> Class A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor could also be used to redirect or augment the TopLink cache with an alternate cache mechanism. EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor. As with IdentityMaps an entire class inheritance hierarchy will share the same interceptor.
| |
| getCacheInterceptorClassName | back to summary |
|---|---|
| public String getCacheInterceptorClassName() A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor could also be used to redirect or augment the TopLink cache with an alternate cache mechanism. EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor. As with IdentityMaps an entire class inheritance hierarchy will share the same interceptor. | |
| getCacheIsolation | back to summary |
|---|---|
| public CacheIsolationType getCacheIsolation() PUBLIC: Controls how the Entity instances will be cached. See the CacheIsolationType for details on the options.
| |
| getCacheKeyType | back to summary |
|---|---|
| public CacheKeyType getCacheKeyType() ADVANCED: Return what cache key type to use to store the object in the cache. | |
| getCacheSynchronizationType | back to summary |
|---|---|
| public int getCacheSynchronizationType() PUBLIC: Get a value indicating the type of cache synchronization that will be used on objects of this type. Possible values are: SEND_OBJECT_CHANGES INVALIDATE_CHANGED_OBJECTS SEND_NEW_OBJECTS+WITH_CHANGES DO_NOT_SEND_CHANGES
| |
| getDatabaseChangeNotificationType | back to summary |
|---|---|
| public DatabaseChangeNotificationType getDatabaseChangeNotificationType() Returns what type of database change notification an entity/descriptor should use. This is only relevant if the persistence unit/session has been configured with a DatabaseEventListener, such as the OracleChangeNotificationListener that receives database change events. This allows for the EclipseLink cache to be invalidated or updated from database changes. | |
| getFullyMergeEntity | back to summary |
|---|---|
public boolean getFullyMergeEntity()
| |
| getIdentityMapClass | back to summary |
|---|---|
| public <T extends IdentityMap> Class INTERNAL: Return the class of identity map to be used by this descriptor. The default is the "SoftCacheWeakIdentityMap".
| |
| getIdentityMapSize | back to summary |
|---|---|
| public int getIdentityMapSize() PUBLIC: Return the size of the identity map. | |
| getRemoteIdentityMapClass | back to summary |
|---|---|
| public <T extends IdentityMap> Class INTERNAL: Return the class of identity map to be used by this descriptor. The default is the "SoftCacheWeakIdentityMap".
| |
| getRemoteIdentityMapSize | back to summary |
|---|---|
| public int getRemoteIdentityMapSize() PUBLIC: Return the size of the remote identity map. | |
| getUnitOfWorkCacheIsolationLevel | back to summary |
|---|---|
| public int getUnitOfWorkCacheIsolationLevel() ADVANCED: Return the unit of work cache isolation setting. This setting configures how the session cache will be used in a unit of work. | |
| hasCacheIndexes | back to summary |
|---|---|
| public boolean hasCacheIndexes() | |
| indexObjectInCache | back to summary |
|---|---|
| public void indexObjectInCache(CacheKey cacheKey, AbstractRecord databaseRow, Object domainObject, ClassDescriptor descriptor, AbstractSession session, boolean refresh) INTERNAL: Index the object by index in the cache using its row. | |
| indexObjectInCache | back to summary |
|---|---|
| public void indexObjectInCache(CacheKey cacheKey, Object object, ClassDescriptor descriptor, AbstractSession session, boolean refresh) INTERNAL: Index the object by index in the cache using the object. | |
| indexObjectInCache | back to summary |
|---|---|
| public void indexObjectInCache(ObjectChangeSet changeSet, Object object, ClassDescriptor descriptor, AbstractSession session) INTERNAL: Index the object by index in the cache using its changeSet. | |
| initialize | back to summary |
|---|---|
| public void initialize(ClassDescriptor descriptor, AbstractSession session) throws DescriptorException INTERNAL: Allow the inheritance properties of the descriptor to be initialized. The descriptor's parent must first be initialized. | |
| initializeFromParent | back to summary |
|---|---|
| public void initializeFromParent(CachePolicy parentPolicy, ClassDescriptor descriptor, ClassDescriptor descriptorDescriptor, AbstractSession session) throws DescriptorException INTERNAL: Allow the inheritance properties of the descriptor to be initialized. The descriptor's parent must first be initialized. | |
| isIndexableExpression | back to summary |
|---|---|
| public boolean isIndexableExpression(Expression expression, ClassDescriptor descriptor, AbstractSession session) INTERNAL: Lookup the expression in the cache if it contains any indexes. | |
| isIsolated | back to summary |
|---|---|
| public boolean isIsolated() PUBLIC: Returns true if the descriptor represents an isolated class | |
| isProtectedIsolation | back to summary |
|---|---|
| public boolean isProtectedIsolation() PUBLIC: Returns true if the descriptor represents a protected class. | |
| isSharedIsolation | back to summary |
|---|---|
| public boolean isSharedIsolation() PUBLIC: Returns true if the descriptor represents a shared class. | |
| postInitialize | back to summary |
|---|---|
| public void postInitialize(ClassDescriptor descriptor, AbstractSession session) throws DescriptorException INTERNAL: Initialize the cache isolation setting. This may need to be called multiple times as notifyReferencingDescriptorsOfIsolation() can change the cache isolation. | |
| setCacheable | back to summary |
|---|---|
| public void setCacheable(Boolean cacheable) INTERNAL: Set entity @Cacheable annotation value.
| |
| setCacheCoordinationType | back to summary |
|---|---|
| public void setCacheCoordinationType(CacheCoordinationType type) PUBLIC: Set the type of cache coordination that will be used on objects of this type. Valid values defined in CacheCoordinationType. | |
| setCacheIndexes | back to summary |
|---|---|
| public void setCacheIndexes(Map<List<DatabaseField>, CacheIndex> cacheIndexes) | |
| setCacheInterceptorClass | back to summary |
|---|---|
| public void setCacheInterceptorClass(Class<? extends CacheInterceptor> cacheInterceptorClass) PUBLIC: A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor could also be used to redirect or augment the TopLink cache with an alternate cache mechanism. EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor. As with IdentityMaps an entire class inheritance hierarchy will share the same interceptor. | |
| setCacheInterceptorClassName | back to summary |
|---|---|
| public void setCacheInterceptorClassName(String cacheInterceptorClassName) PUBLIC: A CacheInterceptor is an adaptor that when overridden and assigned to a Descriptor all interaction between EclipseLink and the internal cache for that class will pass through the Interceptor. Advanced users could use this interceptor to audit, profile or log cache access. This Interceptor could also be used to redirect or augment the TopLink cache with an alternate cache mechanism. EclipseLink's configurated IdentityMaps will be passed to the Interceptor constructor. As with IdentityMaps an entire class inheritance hierarchy will share the same interceptor. | |
| setCacheIsolation | back to summary |
|---|---|
| public void setCacheIsolation(CacheIsolationType isolationType) PUBLIC: Controls how the Entity instances and data will be cached. See the CacheIsolationType for details on the options. To disable all second level caching simply set CacheIsolationType.ISOLATED. Note that setting the isolation will automatically set the corresponding cacheSynchronizationType. ISOLATED = DO_NOT_SEND_CHANGES, PROTECTED and SHARED = SEND_OBJECT_CHANGES | |
| setCacheKeyType | back to summary |
|---|---|
| public void setCacheKeyType(CacheKeyType cacheKeyType) ADVANCED: Set what cache key type to use to store the object in the cache. | |
| setCacheSynchronizationType | back to summary |
|---|---|
| public void setCacheSynchronizationType(int type) OBSOLETE: Set the type of cache coordination that will be used on objects of this type. Possible values are:
This has been replaced by setCacheCoordinationType().
| |
| setDatabaseChangeNotificationType | back to summary |
|---|---|
| public void setDatabaseChangeNotificationType(DatabaseChangeNotificationType databaseChangeNotificationType) Configures what type of database change notification an entity/descriptor should use. This is only relevant if the persistence unit/session has been configured with a DatabaseEventListener, such as the OracleChangeNotificationListener that receives database change events. This allows for the EclipseLink cache to be invalidated or updated from database changes. | |
| setFullyMergeEntity | back to summary |
|---|---|
public void setFullyMergeEntity(boolean fullyMergeEntity)
| |
| setIdentityMapClass | back to summary |
|---|---|
| public void setIdentityMapClass(Class<? extends IdentityMap> theIdentityMapClass) PUBLIC: Set the class of identity map to be used by this descriptor. The default is the "FullIdentityMap". | |
| setIdentityMapSize | back to summary |
|---|---|
| public void setIdentityMapSize(int identityMapSize) PUBLIC: Set the size of the identity map to be used by this descriptor. The default is the 100. | |
| setPrefetchCacheKeys | back to summary |
|---|---|
| public void setPrefetchCacheKeys(boolean prefetchCacheKeys) | |
| setRemoteIdentityMapClass | back to summary |
|---|---|
| public void setRemoteIdentityMapClass(Class<? extends IdentityMap> theIdentityMapClass) PUBLIC: Set the class of identity map to be used by this descriptor. The default is the "FullIdentityMap". | |
| setRemoteIdentityMapSize | back to summary |
|---|---|
| public void setRemoteIdentityMapSize(int identityMapSize) PUBLIC: Set the size of the identity map to be used by this descriptor. The default is the 100. | |
| setShouldAlwaysRefreshCache | back to summary |
|---|---|
| public void setShouldAlwaysRefreshCache(boolean shouldAlwaysRefreshCache) PUBLIC:
When the
However, if a query hits the cache, data is not refreshed regardless of how this setting is configured.
For example, by default, when a query for a single object based on its primary key is executed, OracleAS TopLink
will first look in the cache for the object. If the object is in the cache, the cached object is returned and
data is not refreshed. To avoid cache hits, use the
Also note that the
Use this property with caution because it can lead to poor performance and may refresh on queries when it is not desired.
Normally, if you require fresh data, it is better to configure a query with
When the | |
| setShouldAlwaysRefreshCacheOnRemote | back to summary |
|---|---|
| public void setShouldAlwaysRefreshCacheOnRemote(boolean shouldAlwaysRefreshCacheOnRemote) PUBLIC:
When the
Also note that the
Use this property with caution because it can lead to poor performance and may refresh on queries when it is
not desired. Normally, if you require fresh data, it is better to configure a query with
When the | |
| setShouldDisableCacheHits | back to summary |
|---|---|
| public void setShouldDisableCacheHits(boolean shouldDisableCacheHits) PUBLIC: Set if cache hits on primary key read object queries should be disabled.
| |
| setShouldDisableCacheHitsOnRemote | back to summary |
|---|---|
| public void setShouldDisableCacheHitsOnRemote(boolean shouldDisableCacheHitsOnRemote) PUBLIC: Set if the remote session cache hits on primary key read object queries is allowed or not. | |
| setShouldOnlyRefreshCacheIfNewerVersion | back to summary |
|---|---|
| public void setShouldOnlyRefreshCacheIfNewerVersion(boolean shouldOnlyRefreshCacheIfNewerVersion) PUBLIC:
When the
However, if a query hits the cache, data is not refreshed regardless of how this setting is configured. For example, by default,
when a query for a single object based on its primary key is executed, OracleAS TopLink will first look in the cache for the object.
If the object is in the cache, the cached object is returned and data is not refreshed. To avoid cache hits, use
the
Also note that the
When the | |
| setUnitOfWorkCacheIsolationLevel | back to summary |
|---|---|
| public void setUnitOfWorkCacheIsolationLevel(int unitOfWorkCacheIsolationLevel) ADVANCED: This setting configures how the session cache will be used in a unit of work. Most of the options only apply to a unit of work in an early transaction, such as a unit of work that was flushed (writeChanges), issued a modify query, or acquired a pessimistic lock. USE_SESSION_CACHE_AFTER_TRANSACTION - Objects built from new data accessed after a unit of work early transaction are stored in the session cache. This options is the most efficient as it allows the cache to be used after an early transaction. This should only be used if it is known that this class is not modified in the transaction, otherwise this could cause uncommitted data to be loaded into the session cache. ISOLATE_NEW_DATA_AFTER_TRANSACTION - Default (when using caching): Objects built from new data accessed after a unit of work early transaction are only stored in the unit of work. This still allows previously cached objects to be accessed in the unit of work after an early transaction, but ensures uncommitted data will never be put in the session cache by storing any object built from new data only in the unit of work. ISOLATE_CACHE_AFTER_TRANSACTION - After a unit of work early transaction the session cache is no longer used for this class. Objects will be directly built from the database data and only stored in the unit of work, even if previously cached. Note that this may lead to poor performance as the session cache is bypassed after an early transaction. ISOLATE_CACHE_ALWAYS - Default (when using isolated cache): The session cache will never be used for this class. Objects will be directly built from the database data and only stored in the unit of work. New objects and changes will also never be merged into the session cache. Note that this may lead to poor performance as the session cache is bypassed, however if this class is isolated or pessimistic locked and always accessed in a transaction, this can avoid having to build two copies of the object. | |
| shouldAlwaysRefreshCache | back to summary |
|---|---|
| public boolean shouldAlwaysRefreshCache() PUBLIC:
This method returns
| |
| shouldAlwaysRefreshCacheOnRemote | back to summary |
|---|---|
| public boolean shouldAlwaysRefreshCacheOnRemote() PUBLIC:
This method returns
| |
| shouldDisableCacheHits | back to summary |
|---|---|
| public boolean shouldDisableCacheHits() PUBLIC: Return if for cache hits on primary key read object queries to be disabled.
| |
| shouldDisableCacheHitsOnRemote | back to summary |
|---|---|
| public boolean shouldDisableCacheHitsOnRemote() PUBLIC: Return if the remote server session cache hits on primary key read object queries is aloowed or not. | |
| shouldIsolateObjectsInUnitOfWork | back to summary |
|---|---|
| public boolean shouldIsolateObjectsInUnitOfWork() INTERNAL: Return if the unit of work should by-pass the session cache. Objects will be built in the unit of work, and never merged into the session cache. | |
| shouldIsolateObjectsInUnitOfWorkEarlyTransaction | back to summary |
|---|---|
| public boolean shouldIsolateObjectsInUnitOfWorkEarlyTransaction() INTERNAL: Return if the unit of work should by-pass the session cache after an early transaction. | |
| shouldIsolateProtectedObjectsInUnitOfWork | back to summary |
|---|---|
| public boolean shouldIsolateProtectedObjectsInUnitOfWork() INTERNAL: Return if the unit of work should by-pass the IsolatedSession cache. Objects will be built/merged into the unit of work and into the session cache. but not built/merge into the IsolatedClientSession cache. | |
| shouldOnlyRefreshCacheIfNewerVersion | back to summary |
|---|---|
| public boolean shouldOnlyRefreshCacheIfNewerVersion() PUBLIC:
This method returns | |
| shouldPrefetchCacheKeys | back to summary |
|---|---|
| public boolean shouldPrefetchCacheKeys() | |
| shouldUseSessionCacheInUnitOfWorkEarlyTransaction | back to summary |
|---|---|
| public boolean shouldUseSessionCacheInUnitOfWorkEarlyTransaction() INTERNAL: Return if the unit of work should use the session cache after an early transaction. | |
| useFullIdentityMap | back to summary |
|---|---|
| public void useFullIdentityMap() PUBLIC: Set the class of identity map to be the full identity map. This map caches all instances read and grows to accomodate them. The default is the "SoftCacheWeakIdentityMap". | |
| useHardCacheWeakIdentityMap | back to summary |
|---|---|
| public void useHardCacheWeakIdentityMap() PUBLIC: Set the class of identity map to be the hard cache weak identity map. This map uses weak references to only cache object in-memory. It also includes a secondary fixed sized hard cache to improve caching performance. This is provided because some Java VM's implement soft references differently. The default is the "SoftCacheWeakIdentityMap". | |
| useNoIdentityMap | back to summary |
|---|---|
| public void useNoIdentityMap() PUBLIC: Set the class of identity map to be the no identity map. This map does no caching. Note This map does not maintain object identity. In general if caching is not desired a WeakIdentityMap should be used with an isolated descriptor. The default is the "SoftCacheWeakIdentityMap". | |
| useSoftIdentityMap | back to summary |
|---|---|
| public void useSoftIdentityMap() PUBLIC: Set the class of identity map to be the soft identity map. This map uses soft references to only cache all object in-memory, until memory is low. Note that "low" is interpreted differently by different JVM's. The default is the "SoftCacheWeakIdentityMap". | |
| useWeakIdentityMap | back to summary |
|---|---|
| public void useWeakIdentityMap() PUBLIC: Set the class of identity map to be the weak identity map. The default is the "SoftCacheWeakIdentityMap". | |