Transactions
Description
GridGain supports the following functions that allow you to start, commit, or rollback a transaction:
BEGIN [TRANSACTION]
COMMIT [TRANSACTION]
ROLLBACK [TRANSACTION]
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.
The ROLLBACK [TRANSACTION]
statement undoes all updates made since the last time a COMMIT
or ROLLBACK
command was issued.
Example
Add a person and update the city population by 1 in a single transaction.
BEGIN;
INSERT INTO Person (id, name, city_id) VALUES (1, 'John Doe', 3);
UPDATE City SET population = population + 1 WHERE id = 3;
COMMIT;
Roll back the changes made by the previous commands.
BEGIN;
INSERT INTO Person (id, name, city_id) VALUES (1, 'John Doe', 3);
UPDATE City SET population = population + 1 WHERE id = 3;
© 2024 GridGain Systems, Inc. All Rights Reserved. Privacy Policy | Legal Notices. GridGain® is a registered trademark of GridGain Systems, Inc.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.