|Support for SQL transactions is currently in the beta stage. For production use, consider key-value transactions.|
Ignite supports the following statements that allow users to start, commit, or rollback a transaction.
BEGIN [TRANSACTION] COMMIT [TRANSACTION] ROLLBACK [TRANSACTION]
BEGINstatement begins a new transaction.
COMMITcommits the current transaction.
ROLLBACKrolls back the current transaction.
|DDL statements are not supported inside transactions.|
ROLLBACK commands allow you to manage SQL Transactions. A transaction is a sequence of SQL operations that starts with the
BEGIN statement and ends with the
COMMIT statement. Either all of the operations in a transaction succeed or they all fail.
ROLLBACK [TRANSACTION] statement undoes all updates made since the last time a
ROLLBACK command was issued.
Add a person and update the city population by 1 in a single transaction and commit it.
BEGIN; INSERT INTO Person (id, name, city_id) VALUES (1, 'John Doe', 3); UPDATE City SET population = population + 1 WHERE id = 3; COMMIT;
Add a person, update the city population and then roll back changes instead of committing them.
BEGIN; INSERT INTO Person (id, name, city_id) VALUES (1, 'John Doe', 3); UPDATE City SET population = population + 1 WHERE id = 3; ROLLBACK;
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.