HCL Commerce Version 9.1.9.0

Defining custom caches in the WebSphere Application Server configuration

To be able to use DynaCache APIs to operate a cache, the cache first needs to be declared in the WebSphere Application Server configuration.

The steps differ depending on the server in use:

  1. Transaction server container: Runtime Configuration
  2. WebSphere Application Server V8.5.5 Liberty-based containers
  3. Development Environment

Transaction server container: Runtime Configuration

Use the add-object-cache run engine command to add a custom cache to the configuration.
run add-objectcache jndiName cacheSize NONE sizeMB
For example:
run add-objectcache “services/cache/CustomCache1” 2000 NONE 100

Caches are created by default using the HCL Cache provider. If a different cache provider, such as DynaCache or WebSphere Extreme Scale, is required, use the set-cache-provider run engine command to reconfigure the cache.

WebSphere Application Server V8.5.5 Liberty-based containers

With WebSphere Application Server V8.5.5 Liberty-based containers, custom caches are defined in the configDropins directory:
  1. 1. Create a custom customcache.xml file under the configDropins/overrides directory.
    /opt/WebSphere/Liberty/usr/servers/default/configDropins/overrides/customcache.xml
  2. 2. Define the new caches within the XML as follows.
    <?xml version="1.0" encoding="UTF-8"?>
    <server>
       <distributedMap id="services/cache/CustomCache1" memorySizeInEntries="2000" memorySizeInMB="100" cacheProviderName="hcl-cache"/>
    </server>
    
Note: When using the HCL Cache provider, disk off-load configurations are not supported.

Development Environment

Custom caches can be defined for each server type. For WebSphere Application Server V8.5.5 Liberty servers, or Liberty-based containers, follow the runtime steps as outlined under WebSphere Application Server V8.5.5 Liberty-based containers.

For the Transaction server running under the HCL Commerce test environment, custom caches can be added using the WebSphere Application Server Administrative Console:

  1. In the WebSphere Application Server Administrative Console, click Resources > Cache instances > Object cache instances.
  2. Enter the required display name for the resource in the Name field.
  3. Enter the resource's JNDI name and the JNDI description.

    For example, for a custom cache value can use this format:
    services/cache/MyCustomCache
  4. Use HCL Cache as the cache-provider.
  5. Set a cache size of 2000 entries; if necessary, this value can be increased or decreased depending on cache utilization.

Click Apply or OK.