|Configuring the Native Client Cache / Region Entries|
A region is populated with cached entries in several ways:
If any cache writer is available in the distributed region, it is called before the entry is created and it can abort the creation process.
If just the local cache is to be populated, you can either create an entry using the localCreate Region API, or put an entry using localPut. See the C++ and .NET online API documentation for details about localCreate and localPut.
DateTime objects must be stored in the cache in UTC, so that times correspond between client and server. If you use a date with a different time zone, convert it when storing into and retrieving from the cache. This example converts a local time to UTC for a put operation:
DateTime t1( 2009, 8, 13, 4, 11, 0, DateTimeKind.Local); region0.Put( 1, t1.ToUniversalTime() );
If you need to add many cache entries to a region at one time, you can improve cache performance by using the putAll function to add them in a single distributed operation. Multiple key/value pairs are stored in a hashmap, then the hashmap contents are processed on the server as either new entries, updates, or invalidates for existing entries.
Under Adding an Entry to the Cache see "Bulk Put Operations Using putAll" for more information about the putAll API. Additional details are available in the online API documentation for Region::putAll (C++), or Region.PutAll (.NET).