Console - BEGIN
Initiates a transaction. When a transaction is open, any commands you execute on the database remain temporary. In the event that you are satisfied with the changes, you can call the COMMIT command to commit them to the database. Otherwise, you can call the ROLLBACK command, to roll the changes back to the point where you called BEGIN.
Syntax:
BEGIN
Examples
Begin a transaction:
orientdb>BEGINTransaction 1 is runningAttempting to begin a transaction when one is already open:
orinetdb>BEGINError: an active transaction is currently open (id=1). Commit or rollback before starting a new one.Making changes when a transaction is open:
orientdb>INSERT INTO Account (name) VALUES ('tx test')SELECT FROM Account WHERE name LIKE 'tx%'---+-------+---------- # | RID | name ---+-------+---------- 0 | #9:-2 | tx test ---+-------+----------
When a transaction is open, new records all have temporary Record ID's, which are given negative values, (for instance, #9:-2 above). These remain in effect until you run COMMIT
For more information on Transactions, see