Package org.infinispan.commons.api
Interface BatchingCache
- All Known Subinterfaces:
AdvancedCache<K,
,V> Cache<K,
,V> SecureCache<K,
V>
- All Known Implementing Classes:
AbstractDelegatingAdvancedCache
,AbstractDelegatingCache
,CacheImpl
,DecoratedCache
,EncoderCache
,SecureCacheImpl
,SimpleCacheImpl
,StatsCollectingCache
public interface BatchingCache
The BatchingCache is implemented by all caches which support batching
- Since:
- 6.0
- Author:
- Tristan Tarrant
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endBatch
(boolean successful) Completes a batch if one has been started usingstartBatch()
.boolean
Starts a batch.
-
Method Details
-
startBatch
boolean startBatch()Starts a batch. All operations on the current client thread are performed as a part of this batch, with locks held for the duration of the batch and any remote calls delayed till the end of the batch.- Returns:
- true if a batch was successfully started; false if one was available and already running.
-
endBatch
void endBatch(boolean successful) Completes a batch if one has been started usingstartBatch()
. If no batch has been started, this is a no-op.- Parameters:
successful
- if true, the batch completes, otherwise the batch is aborted and changes are not committed.
-