Skip to content

Console Command Rollback

lvca edited this page Dec 14, 2012 · 7 revisions

Rollbacks an active transaction

Introduction

OrientDB supports transactions. Once a transaction is begun you can abort changes in transactions by using the rollback command.

Syntax

    rollback

Example

    orientdb> begin
    Transaction 1 is running
    
    orientdb> begin
    Error: an active transaction is currently open (id=1). Commit or rollback before starting a new one.
    
    orientdb> insert into account (name) values ('tx test')
    
    Inserted record 'Account#9:-2{name:tx test} v0' in 0,004000 sec(s).
    
    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).
    
    orientdb> rollback
    Transaction 1 has been rollbacked in 4ms
    
    orientdb> select from account where name like 'tx%'
    
    0 item(s) found. Query executed in 0.037 sec(s).
Clone this wiki locally