Configuring custom DynaCache objects in HCL Commerce

Define the custom cache in WebSphere Application Server. You can then use the cache name to store and retrieve the cache objects.

Cache object configuration in WebSphere Application Server

In HCL Commerce, the custom cache can be configured in two ways:
  • Run Engine command for configuring docker container
  • Development environment

Run Engine command for configuring docker container

HCL Commerce provides the following Run Engine commands to configure the custom caches in the runtime environment:
  • Create new object cache instance.
    run add-objectcache jndi cacheSize replicationType
    jndi
    The JNDI name of the object cache.
    cacheSize
    (Integer) The maximum size, in number of entries, of the object cache.
    replicationType
    Important: This parameter is deprecated and is currently ignored. It is kept for backwards compatibility only and will be removed in future releases.
    The replication type of the object cache has following valid values:
    • PULL
    • PUSH
    • PUSH_PULL
    • NONE
    sizeMB

    Optional: (Integer) The size of the object cache in megabytes (MB).

  • Change the WebSphere Application Server data source properties (statement cache size) for a specific data source.
    run set-statement-cache jndi cacheSize
    jndi
    The JNDI name of the datasource.
    cacheSize
    Value for StatementCacheSize.
  • Update the size of object cache instances. The size might be limited to a certain number of lines or megabytes (MB).
    run update-objectcache-size jndi size sizeMB
    jndi
    The JNDI name of the object cache.

    The JNDI value can be basecache (case insensitive) to update the basecache value.

    size
    The maximum size, in number of entries, of the object cache.
    sizeMB
    Optional: The maximum size, in megabytes (MB), of the object cache.
Note: For more details of each Run Engine command, see Transaction server Run Engine commands.

Development environment

To configure the custom cache object in a development environment, follow the steps outlined below in the WebSphere Application Server Administration Console:

  1. In the WebSphere Application Server Administration Console, click Resources > Cache instances > Object cache instances.
  2. To view and configure the cache instances that are available to all servers within the cell, specify the CELL SCOPE.
  3. Specify the NODE SCOPE to view and configure cache instances that are available to all servers with the particular node.
  4. Specify the SERVER SCOPE to view and configure the cache instances that are available only on the specific server.
  5. Enter the required display name for the resource in the Name field.
  6. Enter the resource's JNDI name and the JNDI description.
    A custom cache value, for example, should be in the following format:
    services/cache/MyCustomCache
  7. Keep HCL Cache as the cache-provider.
  8. Set a cache size of 2000 entries; if necessary, this value can be increased or decreased depending on cache utilization.
  9. Click Apply or OK.
Note: For more information on how to configure the custom Dynacache caches in the WebSphere Liberty server, see Configuring custom DynaCache objects in WebSphere Liberty.