You can configure your embedded global cache to use locking
strategies to suit the types of data that you store in your cache.
Before you begin
Complete the following steps:
About this task
You define the locking strategy for each cache map in
your embedded global cache by configuring the objectgrid.xml file.
You then configure the embedded global cache by updating the server.conf.yaml configuration
file for the integration server to point to the objectgrid.xml file.
The embedded global cache can use only one objectgrid.xml file.
Procedure
- Open the objectgrid.xml file, and
configure the locking strategy for each
backingMap
entry
by completing one of the following steps:
- To configure the pessimistic locking strategy for a cache
map, set the lockStrategy parameter to PESSIMISTIC.
For
example:
<backingMap name="USER.PESSIMISTIC.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="PESSIMISTIC" copyMode="COPY_TO_BYTES"/>
- To configure the optimistic locking strategy for a cache map,
set the lockStrategy parameter to OPTIMISTIC_NO_VERSIONING.
You can also set the nearCacheInvalidationEnabled parameter
to true.
For example:
<backingMap name="USER.OPTIMISTIC.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="OPTIMISTIC_NO_VERSIONING" nearCacheInvalidationEnabled="true" copyMode="COPY_TO_BYTES"/>
- To configure no locking for a cache map, set the lockStrategy parameter
to NONE. You can also set the nearCacheInvalidationEnabled parameter
to true.
For example:
<backingMap name="USER.NONE.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="NONE" nearCacheInvalidationEnabled="true" copyMode="COPY_TO_BYTES"/>
The following
example file shows three entries, and includes an entry (
SYSTEM.BROKER.*
)
that matches the default cache map for the
IBM® App Connect Enterprise embedded global cache.
Note: You
can modify the locking strategy for the SYSTEM.BROKER.*
entry
but you must not remove the entry.
<?xml version="1.0" encoding="UTF-8"?>
<objectGridConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibm.com/ws/objectgrid/config ../objectGrid.xsd"
xmlns="http://ibm.com/ws/objectgrid/config">
<objectGrids>
<objectGrid name="WMB">
<backingMap name="USER.OPTIMISTIC.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="OPTIMISTIC_NO_VERSIONING" nearCacheInvalidationEnabled="true" copyMode="COPY_TO_BYTES"/>
<backingMap name="USER.PESSIMISTIC.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="PESSIMISTIC" copyMode="COPY_TO_BYTES"/>
<backingMap name="USER.NONE.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="NONE" nearCacheInvalidationEnabled="true" copyMode="COPY_TO_BYTES"/>
<backingMap name="SYSTEM.BROKER.*" template="true" timeToLive="0" ttlEvictorType="LAST_UPDATE_TIME" lockStrategy="PESSIMISTIC" copyMode="COPY_TO_BYTES"/>
</objectGrid>
</objectGrids>
</objectGridConfig>
- Save the objectgrid.xml file.
- Configure the location of the objectgrid.xml file,
by modifying the objectGridCustomFile property
in the server.conf.yaml configuration file for
the integration server.
- Restart the integration server for the changes to take
effect.
Results
You have configured the IBM App Connect Enterprise embedded
global cache to use one or more locking strategies.