Method: LMDB::Transaction#abort

Defined in:
ext/lmdb_ext/lmdb_ext.c

#abortObject

Note:

After aborting a transaction, no further database operations should be done in the block. Any cursors created in the context of the transaction will no longer be valid.

Abort a transaction in process. Any subtransactions of this transaction will be aborted as well.

Examples:

Single transaction

env.transaction do |txn|
  # ... modify the databases ...
  txn.abort
  # modifications are rolled back
end

Child transactions

env.transaction do |txn1|
  env.transaction.do |txn2|
     txn1.abort      # txn1 and txn2 are both aborted
  end
end


110
111
112
113
# File 'ext/lmdb_ext/lmdb_ext.c', line 110

static VALUE transaction_abort(VALUE self) {
        transaction_finish(self, 0);
        return Qnil;
}