Skip to contents

Discards the transaction's writes and ends it. Aborting is idempotent: doing it to an already-finished transaction does nothing, so it is safe to register with on.exit() alongside an explicit mdbx_txn_commit().

Usage

mdbx_txn_abort(txn)

Arguments

txn

An mdbx_txn object, from mdbx_txn_begin().

Value

NULL, invisibly.

Examples

path <- tempfile(fileext = ".mdbx")
env <- mdbx_env_open(path)

txn <- mdbx_txn_begin(env, write = TRUE)
mdbx_txn_abort(txn)
mdbx_txn_abort(txn) # already aborted; does nothing

mdbx_env_close(env)
unlink(c(path, paste0(path, "-lck")))