From acdaeeab5c7b2c9543936c48fd6d8d4ae5ebab3d Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Wed, 15 Feb 2017 19:50:23 +0300 Subject: [PATCH] mdbx: notes about free/reuse cursors. --- lmdb.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lmdb.h b/lmdb.h index b6a55f11..0fded84e 100644 --- a/lmdb.h +++ b/lmdb.h @@ -1039,8 +1039,16 @@ size_t mdb_txn_id(MDB_txn *txn); * * The transaction handle is freed. It and its cursors must not be used * again after this call, except with #mdb_cursor_renew(). - * @note Earlier documentation incorrectly said all cursors would be freed. + * + * @note MDBX-mode: + * A cursor must be closed explicitly always, before + * or after its transaction ends. It can be reused with + * #mdb_cursor_renew() before finally closing it. + * + * @note LMDB-compatible mode: + * Earlier documentation incorrectly said all cursors would be freed. * Only write-transactions free cursors. + * * @param[in] txn A transaction handle returned by #mdb_txn_begin() * @return A non-zero error value on failure and 0 on success. Some possible * errors are: @@ -1057,8 +1065,16 @@ int mdb_txn_commit(MDB_txn *txn); * * The transaction handle is freed. It and its cursors must not be used * again after this call, except with #mdb_cursor_renew(). - * @note Earlier documentation incorrectly said all cursors would be freed. + * + * @note MDBX-mode: + * A cursor must be closed explicitly always, before + * or after its transaction ends. It can be reused with + * #mdb_cursor_renew() before finally closing it. + * + * @note LMDB-compatible mode: + * Earlier documentation incorrectly said all cursors would be freed. * Only write-transactions free cursors. + * * @param[in] txn A transaction handle returned by #mdb_txn_begin() */ int mdb_txn_abort(MDB_txn *txn);