SQL Transactions | Ignite Documentation

Ignite Summit: Сloud Edition | Using Ignite In The Cloud - Watch On Demand →


SQL Transactions

Support for SQL transactions is currently in the beta stage. For production use, consider key-value transactions.


SQL Transactions are supported for caches that use the TRANSACTIONAL_SNAPSHOT atomicity mode. The TRANSACTIONAL_SNAPSHOT mode is the implementation of multiversion concurrency control (MVCC) for Ignite caches. For more information about MVCC and current limitations, visit the Multiversion Concurrency Control page.

See the Transactions page for the transaction syntax supported by Ignite.

Enabling MVCC

To enable MVCC for a cache, use the TRANSACTIONAL_SNAPSHOT atomicity mode in the cache configuration. If you create a table with the CREATE TABLE command, specify the atomicity mode as a parameter in the WITH part of the command:

<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_SNAPSHOT"/>

CacheConfiguration cacheCfg = new CacheConfiguration<>();

var cacheCfg = new CacheConfiguration
    Name = "myCache",
    AtomicityMode = CacheAtomicityMode.TransactionalSnapshot
This API is not presently available for C++. You can use XML configuration.


Cross-Cache Transactions

The TRANSACTIONAL_SNAPSHOT mode is enabled per cache and does not permit caches with different atomicity modes within one transaction. Thus, if you want to cover multiple tables in one SQL transaction, all tables must be created with the TRANSACTIONAL_SNAPSHOT mode.

Nested Transactions

Ignite supports three modes of handling nested SQL transactions that can be enabled via a JDBC/ODBC connection parameter.


When a nested transaction occurs within another transaction, the system behavior depends on the nestedTransactionsMode parameter:

  • ERROR — When the nested transaction is encountered, an error is thrown and the enclosing transaction is rolled back. This is the default behavior.

  • COMMIT — The enclosing transaction is committed; the nested transaction starts and is committed when its COMMIT statement is encountered. The rest of the statements in the enclosing transaction are executed as implicit transactions.

  • IGNORE — DO NOT USE THIS MODE. The beginning of the nested transaction is ignored, statements within the nested transaction will be executed as part of the enclosing transaction, and all changes will be committed with the commit of the nested transaction. The subsequent statements of the enclosing transaction will be executed as implicit transactions.