public enum CacheAtomicityMode extends Enum<CacheAtomicityMode>
ATOMICmode is used whenever transactions and explicit locking are not needed. Note that in
ATOMICmode cache will still maintain full data consistency across all cache nodes.
Cache atomicity may be set via
|Enum Constant and Description|
Specifies atomic-only cache behaviour.
|Modifier and Type||Method and Description|
Efficiently gets enumerated value from its ordinal.
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final CacheAtomicityMode TRANSACTIONAL
ACID-compliant transactional cache behavior. See
Transactionfor more information about transactions.
This mode is currently the default cache atomicity mode. However, cache
atomicity mode will be changed to
ATOMIC starting from version
so it is recommended that desired atomicity mode is explicitly configured
instead of relying on default value.
public static final CacheAtomicityMode ATOMIC
In addition to transactions and locking, one of the main differences in
is that bulk writes, such as
methods, become simple batch operations which can partially fail. In case of partial
CachePartialUpdateCheckedException will be thrown which will contain a list of keys
for which the update failed. It is recommended that bulk writes are used whenever multiple keys
need to be inserted or updated in cache, as they reduce number of network trips and provide
Note that even without locking and transactions,
ATOMIC mode still provides
full consistency guarantees across all cache nodes.
Also note that all data modifications in
ATOMIC mode are guaranteed to be atomic
and consistent with writes to the underlying persistent store, if one is configured.
This mode is currently implemented for
CacheMode.PARTITIONED caches only.
public static CacheAtomicityMode values()
for (CacheAtomicityMode c : CacheAtomicityMode.values()) System.out.println(c);
public static CacheAtomicityMode valueOf(String name)
@Nullable public static CacheAtomicityMode fromOrdinal(int ord)
ord- Ordinal value.
nullif ordinal out of range.