Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
2.3. Using the Batching API
2.3.1. Enable the Batching API Link kopierenLink in die Zwischenablage kopiert!
Example 2.2. Enable Invocation Batching
<distributed-cache name="default" batching="true" statistics="true"> ... </distributed-cache>
<distributed-cache name="default" batching="true" statistics="true">
...
</distributed-cache>
2.3.2. Configure the Batching API Link kopierenLink in die Zwischenablage kopiert!
To configure the Batching API in the XML file:
<invocationBatching enabled="true" />
<invocationBatching enabled="true" />
To configure the Batching API programmatically use:
Configuration c = new ConfigurationBuilder().invocationBatching().enable().build();
Configuration c = new ConfigurationBuilder().invocationBatching().enable().build();
Note
2.3.3. Use the Batching API Link kopierenLink in die Zwischenablage kopiert!
startBatch() and endBatch() on the cache as follows to use batching:
Cache cache = cacheManager.getCache();
Cache cache = cacheManager.getCache();
Example 2.3. Without Using Batch
cache.put("key", "value");
cache.put("key", "value");
cache.put(key, value); line executes, the values are replaced immediately.
Example 2.4. Using Batch
cache.endBatch(true); executes, all modifications made since the batch started are replicated.
cache.endBatch(false); executes, changes made in the batch are discarded.
2.3.4. Batching API Usage Example Link kopierenLink in die Zwischenablage kopiert!
Example 2.5. Batching API Usage Example