此内容没有您所选择的语言版本。
2.3.3. Use the Batching API
After the cache is configured to use batching, call
startBatch()
and endBatch()
on the cache as follows to use batching:
Cache cache = cacheManager.getCache();
Cache cache = cacheManager.getCache();
Example 2.1. Without Using Batch
cache.put("key", "value");
cache.put("key", "value");
When the
cache.put(key, value);
line executes, the values are replaced immediately.
Example 2.2. Using Batch
When the line
cache.endBatch(true
);
executes, all modifications made since the batch started are replicated.
When the line
cache.endBatch(false
);
executes, changes made in the batch are discarded.