Atomicity Modes
GridGain cache atomicity modes — ATOMIC, TRANSACTIONAL, and TRANSACTIONAL_SNAPSHOT — and how to enable transactional support for a cache.
By default, a cache supports only atomic operations, and bulk operations such as putAll() or removeAll() are executed as a sequence of individual puts and removes. You can enable transactional support and group multiple cache operations, on one or more keys, into a single atomic transaction. These operations are executed without any other interleaved operations on the specified keys, and either all succeed or all fail. There is no partial execution of the operations.
To enable support for transactions for a cache, set the atomicityMode parameter in the cache configuration to TRANSACTIONAL.
GridGain supports 3 atomicity modes, which are described in the following table.
ATOMIC
The default mode. All operations are performed atomically, one at a time. Transactions are not supported. The ATOMIC mode provides better performance by avoiding transactional locks, while providing data atomicity and consistency for each single operation. Bulk writes, such as the putAll(...) and removeAll(...) methods, are not executed in one transaction and can partially fail. If this happens, a CachePartialUpdateException is thrown and contains a list of keys for which the update failed.
TRANSACTIONAL
Enables support for ACID-compliant transactions executed via the key-value API. SQL transactions are not supported. Transactions in this mode can have different concurrency modes and isolation levels. Enable this mode only if you need support for ACID-compliant operations. For more information about transactions, see Performing Transactions.
Note — Performance Considerations: The TRANSACTIONAL mode adds a performance cost to cache operations and should be enabled only if you need transactions.
TRANSACTIONAL_SNAPSHOT
Deprecated. An experimental mode that implements multiversion concurrency control (MVCC) and supports both key-value transactions and SQL transactions. See Multiversion Concurrency Control for details about and limitations of this mode.
Warning: The TRANSACTIONAL_SNAPSHOT mode is deprecated. The MVCC implementation is in beta and is not ready for production use.
You can enable transactions for a cache in the cache configuration.
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="cacheConfiguration">
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="myCache"/>
<property name="atomicityMode" value="TRANSACTIONAL"/>
</bean>
</property>
<!-- Optional transaction configuration. -->
<property name="transactionConfiguration">
<bean class="org.apache.ignite.configuration.TransactionConfiguration">
<!-- Configure TM lookup here. -->
</bean>
</property>
</bean>CacheConfiguration cacheCfg = new CacheConfiguration();
cacheCfg.setName("cacheName");
cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg = Util.getIgniteCfg();
cfg.setCacheConfiguration(cacheCfg);
// Optional transaction configuration. Configure TM lookup here.
TransactionConfiguration txCfg = new TransactionConfiguration();
cfg.setTransactionConfiguration(txCfg);
// Start a node
Ignition.start(cfg);unsupported
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

