Feature Pack 7 or later

Configuring the memory cache

To save database queries for the INVCNF and INVCNFREL tables, you can cache the content of these tables to memory. The memory cache for both the INVCNF and the INVCNFREL tables is configured in the WCInstall_dir/xml/config/com.ibm.commerce.inventory-ext/wc-admin-component.xml file.


Open the WCInstall_dir/xml/config/com.ibm.commerce.inventory-ext/wc-admin-component.xml file. The file looks like the following example when all of the properties are set:
                <_config:configgrouping name="InventoryConfigurationCache">
                        <!-- load all data into memory to avoid database query -->
                        <_config:property name="LoadAllConfigrationData" value="false"/>

                        <!-- The JNDI name of the inventory configuration cache -->
                        <_config:property name="InventoryConfigurationCacheJNDI" value="dmap/IC_Cache"/>

                        <!-- Whether the cache is used  -->
                        <_config:property name="UseCache" value="true"/>

                <_config:configgrouping name="MemoryCache">
                        <_config:property name="checkExpiry" value="true"/>

The UseCache property sets the memory cache. If the property is set to true, the memory cache is enabled. If it is set to false, it is disabled.
The name of the (distributed map) cache, where the cache is located, and if it can be operated in Java™. The InventoryConfigurationCacheJNDI takes effect when the memory cache is enabled.

The cache works most efficiently when the INVCNF and the INVCNFREL tables are configured and are loaded into memory first. If the total number of entries is not large, this option can be used.

When an inventory configuration that is based on catentryId/onlineStoreId/physicalStoreId is retrieved and the inventory configuration is not located in the cache, the configuration is loaded from the database and put in the cache. In this scenario, the cache key is composed with catentryId/onlineStoreId/physicalStoreId.

Important: The default value of the LoadAllConfigrationData parameter is set to true, which means only configurations from INVCNF and INVCNFREL are put in the cache.
Note: If you periodically clear the WebSphere® Commerce DistributedMap caches, for example dmap/IC_Cache, then you must set this configuration property to false. Otherwise, the inventory configuration cache is not rebuilt at run time after it is cleared.

The configuration of the checkExpiry parameter indicates whether memory cache expiry is enabled. The default value for this parameter is false.

If checkExpiry is set to false, which is the default value, the memory cache does not expire until it is synchronized by the external system.

If checkExpiry is set to true, the memory cache is automatically refreshed if the inventory configuration criteria is met.