|Configuring the Native Client Cache / Caches|
When you create a native client cache, you are creating a native client cache instance. You must provide some basic configuration information such as a connection name and cache initialization parameters for the native client's cache instance.
The cache.xml file contains XML declarations for cache, region, and region entry configuration.
<cache> <region name="clientRegion1" refid="PROXY"> <region-attributes pool-name="serverPool1"/> </region> <region name="clientRegion2" refid="PROXY"> <region-attributes pool-name="serverPool2"/> </region> <region name="localRegion3" refid="LOCAL"/> <pool name="serverPool1"> <locator host="host1" port="40404"/> </pool> <pool name="serverPool2"> <locator host="host2" port="40404"/> </pool> </cache>
When you use the regions, the client regions connect to the servers through the pools named in their configurations.
This file can have any name, but is generally referred to as cache.xml .
For a list of the parameters in the cache.xml file, including the DTD, see Cache Initialization File.
CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(); CachePtr cachePtr = cacheFactory->create();