I'm trying to plug LMDB into a system where the user first modifies the value, and only afterwards notifies me that the value has been changed. In LMDB I've been simply passing the value pointer received from mdb_cursor_get (db opened with MDB_WRITEMAP), and if the user notifies me that the value has been changed, I commit the write transaction.
Is this an acceptable use pattern? It seems to work (but crashes without MDB_WRITEMAP). Only thing vaguely related I could find here was https://www.openldap.org/lists/openldap-technical/201510/msg00016.html
mnunberg@haskalah.org wrote:
I'm trying to plug LMDB into a system where the user first modifies the value, and only afterwards notifies me that the value has been changed. In LMDB I've been simply passing the value pointer received from mdb_cursor_get (db opened with MDB_WRITEMAP), and if the user notifies me that the value has been changed, I commit the write transaction.
Is this an acceptable use pattern?
No. RTFM.
http://www.lmdb.tech/doc/group__mdb.html#ga48df35fb102536b32dfbb801a47b4cb0
openldap-technical@openldap.org