Distributed hybrid caching relies on four elements:
GSACacheClientManager must be configured on each Oracle Commerce Platform instance that participates in distributed hybrid caching. It initiates invalidation events for repository items that use distributed hybrid caching, and sends event messages to the
GSACacheServerManager
for distribution to other Oracle Commerce Platform instances.GSACacheServerManager directs cache invalidation events to Oracle Commerce Platform instances that contain the affected repository items.
ServerLockManager connects each
GSACacheClientManager
to theGSACacheServerManager
. The ServerLockManager andGSACacheServerManager
must be configured on the same Oracle Commerce Platform instance.An invalidation event of class GSACacheEvent conveys a cache invalidation event for repository items that use distributed hybrid caching.
GSACacheClientManager
A GSACacheClientManager
must be configured on each Oracle Commerce Platform instance where one or more repository item descriptors have their caching mode set to distributedHybrid
. The GSACacheClientManager
has the following Nucleus component path:
/atg/dynamo/service/GSACacheClientManager
Each GSACacheClientManager
must set the following properties:
lockServerAddress=host
[
,host
]
lockServerPort=port-num
[
,port-num]
enabled=true
host
and port-num
specify the ServerLockManager ‘s address and port. If two ServerLockManagers
are specified for failover purposes, lockServerAddress
and lockServerPort
must list their respective addresses and ports in the same order.
For example, given two ServerLockManagers
on hosts tartini.acme-widgets.com
and corelli.acme-widgets.com
, where both use port 9010, you can configure a GSACacheClientManager
component as follows:
lockServerAddress=tartini.acme-widgets.com,corelli.acme-widgets.com lockServerPort=9010,9010 enabled=true
Each ServerLockManager must run in the same Oracle Commerce Platform instance as a GSACacheServerManager
, and must be configured to support distributed hybrid caching. During repository startup, the GSACacheClientManager
connects to the ServerLockManager
, which hands over the connection to the GSACacheSeverManager
; this connection becomes the communication channel between the GSACacheClientManager
and GSACacheServerManager
for cache invalidation events.
For debugging purposes, you can also set the loggingDebug
property to true.
GSACacheServerManager
A GSACacheServerManager
maintains routing information for all cached repository items that use distributed hybrid caching. When a cache invalidation event occurs on a repository, that repository’s GSACacheClientManager
sends the event to its GSACacheServerManager
; the GSACacheServerManager
relays this event to the appropriate clients.
The GSACacheServerManager
has the following Nucleus component path:
/atg/dynamo/service/GSACacheServerManager
To enable a GSACacheServerManager
, set its enabled
property to true
. You can also configure its defaultItemCacheSize
property, which sets the maximum number of items that are mapped for each item descriptor. This property is initially set to 10000. For more information on setting this property, see Optimizing Performance later in this chapter.
Each GSACacheServerManager
is associated with a ServerLockManager that runs in the same Oracle Commerce Platform instance, via the connection information specified by GSACacheClientManagers
. You can provide a backup GSACacheServerManager
by configuring those GSACacheClientManagers
to connect to the same secondary ServerLockManager
. Precedence of GSACacheServerManagers
is set by their respective ServerLockManagers
(see ServerLockManager Failover).
For debugging purposes, you can also set the loggingDebug
property to true.
ServerLockManager
In order to enable distributed hybrid caching, a ServerLockManager
must be configured on the same instance as the GSACacheServerManager
with the following setting:
handleDistributedHybridCacheEvent=true
When thus enabled, the ServerLockManager hands over the connection from a GSACacheClientManager
to the GSACacheSeverManager
; this connection becomes the communication channel between them for all subsequent cache invalidation events.
GSACacheEvent
GSACacheClientManagers
and GSACacheServerManager
communicate with each other by passing GSACacheEvent
objects, which encapsulate invalidation events with the following information:
Repository item ID
Item descriptor name
Event type
The following table describes the four types of GSACacheEvents
:
GSACacheEvent Type | Description |
---|---|
| Sent when a repository item or item descriptor is invalidated. The If the |
| Sent when a repository item is cached. |
| Sent when a repository item is deleted. On receiving this |
| Confirms that a repository item is removed from the cache. On receiving this event, the |
All events except LOAD_INTO_CACHE
are sent asynchronously. LOAD_INTO_CACHE
is sent synchronously in order to ensure a consistent view of item data across all repositories and handle rare race conditions. The GSACacheClientManager
property synchronousMessageTimeout
determines the maximum amount of time each GSACacheClientManager
waits for the GSACacheServerManager
to reply before caching an item. This property ensures threads wait only a finite period of time for a reply from the GSACacheServerManager
. The default setting is 500 milliseconds.
The following graphic shows how the removal of a repository item on server Alamo triggers an invalidation event for all repository caches that also contain that item—in this case, on Oracle Commerce Platform server Houston.