Thanks for the quick reply.

I meant mdb_txn_commit (instead of mdb_txn_close), sorry about that.

> If there was a restriction on usage in read-only txns the docs would have said so.

This is what I guessed too.

However I now have a follow-up question: The documentation for mdb_txn_abort() says:

"The transaction handle is freed. It and its cursors must not be used again after this call, except with #mdb_cursor_renew()."

Could it be worth it to change this to "...except with #mdb_cursor_renew() or #mdb_cursor_close()"? This would have cleared the ambiguity for me (and I would never have created this thread to begin with).

Regards,
Sam


Jan 24, 2022, 17:43 by hyc@symas.com:
Sam Dave wrote:
Hello,


The mdb_cursor_close() documentation says: "Its transaction must still be live if it is a write-transaction."


This leads me to my question: For *read-only* transactions, is it allowed to run mdb_cursor_close() *after* mdb_txn_close() or mdb_txn_abort()?

There is no mdb_txn_close().

If there was a restriction on usage in read-only txns the docs would have said so.

--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/