Administer > Dynamic caching > WebSphere Commerce data cache


Additional WebSphere Commerce data cache configuration


Overview

Further configuration of the WebSphere Commerce data cache can be done by adding a <CrossTransactionCache> element or a <LocalTransactionCache> element to the <InstanceProperties> element of the WebSphere Commerce configuration file.


<CrossTransactionCache> element

The cross transaction cache holds data that persists across transactions until expired by dynacache.

<CrossTransactionCache enabled="[true|false]"
                       commandCaching="[on|off|default]"
                       maxInactivityTime="[seconds|86400]"
                       maxTimeToLive="[seconds|172800]"
                       defaultResultSizeThreshold="[number|8]"
                       clearUserOnLogoff="[true|false]"
                       maxInvalidationldsPerTransaction="[number|1000000]"
                       CacheName="[disabled|DistributedMapName|commandCaching]" > 
     
    <DistributedMapName enabled="[true|false]"
                       maxInactivityTime="seconds"
                       maxTimeToLive="seconds" /> 
      
    <CacheName enabled="[true|false]"
               maxInactivityTime="seconds"
               maxTimeToLive="seconds" /> 

</CrossTransactionCache>

...where...

Element name Possible values (defaults in bold) Usage
enabled true|false Specify false to turn off cross transaction caching
commandCaching on|off|default Set on to force the cross transaction cache to use command caching in the default baseCache DistributedMap. Set off to prevent the cross transaction cache from using command caching. The default setting uses DistributedMap caching when the corresponding DistributedMap is found using it's JNDI name, and otherwise uses command caching in the default DistributedMap.
maxInactivityTime seconds|86400 Number of seconds after which an inactive cache entry is removed from the cache due to inactivity.

This setting has no effect when command caching is used. Instead use the <inactivity> tag in the cachespec.xml file.

maxTimeToLive seconds|172800 Number of seconds after which a cache entry expires and is removed from the cache. This setting has no effect when command caching is used. Instead use the <timeout> tag in the cachespec.xml file.
defaultResultSizeThreshold number|8 When the size of the collection of objects to be cached in a cache entry exceeds the specified threshold value, dependency ids will be generated using only table names and not column names and values, to reduce the number of dependency ids generated for the cache entry.
clearUserOnLogoff true|false Specify false if cache entries specific to a particular user should not be removed from the cache when the user logs off.
maxInvalidationldsPerTransaction number|1000000 Specify the maximum number of cross transaction cache invalidation operations that can be executed in a single transaction. Knowledge of each invalidation operation executed must be retained for the duration of the current transaction. A long running transaction that executes too many invalidation operations can run out of memory. When the specified limit is reached no further invalidationlds are remembered for the cross transaction cache for the remainder of the current transaction. When the transaction completes, the entire cross transaction cache is cleared.
CacheName

For example, com.ibm.commerce.user.objsrc.OrganizationCache

disabled|DistributedMapName |commandCaching CacheName specifies a logical cache used by the Commerce Data Cache. DistributedMapName is a name to be prefixed with services/cache/ to form a JNDI name used to locate a DistributedMap that may be used to hold data for the specified logical cache. The actual DistributedMap used is the first of the following DistributedMap objects found to exist:

  • services/cache/CacheName
  • services/cache/DistributedMapName
  • services/cache/WCDistributedMapCache
  • the default baseCache DistributedMap

Specify disabled to prevent caching for the specified logical cache. Specify commandCaching to use command caching in the default baseCache DistributedMap.

<DistributedMapName/>

For example, <WCUserDistributedMapCache enabled="false"/>

enabled="[true|false]"

maxInactivityTime="seconds"

maxTimeToLive="seconds"

Specify enabled=false to prevent use of the DistributedMap whose name is services/cache/DistributedMapName.

Use the maxInactivityTime and maxTimeToLive settings to override the corresponding global settings. They apply only to cache entries in the specified DistributeMap.

<CacheName/>

For example, <com.ibm.commerce.user.objsrc.OrganizationCache enabled="false"/>

enabled="[true|false]"

maxInactivityTime="seconds"

maxTimeToLive="seconds"

Specify enabled=false to prevent caching for the specified logical cache unless commandCaching has been explicitly specified for that logical cache.

Use the maxInactivityTime and maxTimeToLive settings to override the corresponding global and DistributedMap settings. They apply only to cache entries for the specified logical cache.

The maxInactivityTime and maxTimeToLive settings have no effect when command caching is used. Instead use the <inactivity> and <timeout> tags in the cachespec.xml file.


<LocalTransactionCache> element

The local transaction cache holds cache entries in memory for the duration of a single database transaction.

<LocalTransactionCache
       enabled="[true|false]"
       maxSize="[number|1000000]"
       maxInvalidationldsPerTransaction="[number|1000000]"

       CacheName="[disabled|enabled]"

/>

where:

Element name Possible values (defaults in bold) Usage
enabled true|false Specify false to turn off local transaction caching.

Turning off local transaction caching is not normally recommended, but may be done as part of problem determination.


Warning: Never turn off local transaction caching without also turning off cross transaction caching.

maxSize number|1000000 Specify the maximum number of cache entries that can be remembered for the duration of a transaction.

Each cache entry remains in memory until the current transaction completes. A long running transaction that creates too many cache entries can run out of memory.

When the specified limit is reached, the transaction cache stops creating cache entries for the remainder of the current transaction to prevent an out of memory condition.

maxInvalidationldsPerTransaction number|1000000 Specify the maximum number of cache invalidation operations that can be executed in a single transaction.

Knowledge of each invalidation operation executed must be retained for the duration of the current transaction. A long running transaction that executes too many invalidation operations can run out of memory.

When the specified limit is reached, the entire transaction cache is cleared and knowledge of individual invalidation operations is removed from memory to prevent an out of memory condition. Use of the cross transaction cache is suspended for the remainder of the transaction since all cache entries are considered to be invalidated for the remainder of the transaction.

CacheName disabled|enabled CacheName specifies the name of a logical cache. For example: com.ibm.commerce.user.objsrc.OrganizationCache

Specify disabled to prevent caching in the specified logical cache. Turning off local transaction caching is not normally recommended, but may be done as part of problem determination. Never turn off local transaction caching for a logical cache without also turning off cross transaction caching for the same logical cache.


Related tasks

Enable WebSphere Commerce data cache
Invalidate WebSphere Commerce data cache entries
Logical cache names and the DistributedMaps they use by default
Access bean classes extended to take advantage of WebSphere Commerce data cache
Data bean classes extended to take advantage of WebSpere Commerce data cache


+

Search Tips   |   Advanced Search