| search |
|
|---|
Aborts a transaction, rolling the database back to its save point.
Syntax
BEGINFor more information on transactions, see Transactions. To initiate a transaction, use the
BEGINcommand. To save changes, seeCOMMITcommand.
Example
-
Initiate a new transaction:
orientdb>
BEGINTransaction 1 is running -
Attempt to start a new transaction, while another is open:
orientdb>
BEGINError: an active transaction is currently open (id=1). Commit or rollback before starting a new one. -
Make changes to the database:
orientdb>
INSERT INTO Account (name) VALUES ('tx test')Inserted record 'Account#9:-2{name:tx test} v0' in 0,004000 sec(s). -
View changes in database:
orientdb>
SELECT FROM Account WHERE name LIKE 'tx%'---+-------+-------------------- # | RID | name ---+-------+-------------------- 0 | #9:-2 | tx test ---+-------+-------------------- 1 item(s) found. Query executed in 0.076 sec(s). -
Abort the transaction:
orientdb>
ROLLBACKTransaction 1 has been rollbacked in 4ms -
View rolled back database:
orientdb>
SELECT FROM Account WHERE name LIKE 'tx%'0 item(s) found. Query executed in 0.037 sec(s).
For more information on other commands, see Console Commands.