datalevin 2026-09-05

I have started moving more code to use Datalevin in my project. I recently encountered this error and have not been able to figure out what is causing it. Unfortunately I am not able to share the schema or the data. This is using d/transact! to update an existing record. What would cause this error?

Root: clojure.lang.ExceptionInfo - Fail to transact to LMDB: #error {
 :cause "MDB_KEYEXIST: Key/data pair already exists"
 :via
 [{:type datalevin.cpp.Util$DTLVException
   :message "MDB_KEYEXIST: Key/data pair already exists"
   :at [datalevin.cpp.Util checkRc "Util.java" 63]}]

Narrowed it down to a field that is a Clojure map data structure.

This is with version 1.0.2. Just tried 1.1.0 but ran into https://github.com/datalevin/datalevin/issues/388 There should be only one connection to the DB. The field is untyped so relying on the built-in EDN serialization that Datalevin provides. It is a map with 27 3 keyword vector keys and values are sets of 30-40 keywords. That might be enough to hit giants. I'll see if I can create some test data that can reproduce the issue.

I closed 388. What a rookie mistake on my part. Let me try the master branch. Thanks.

👍 1

The master branch seems to have fixed the issue. Thanks!

✅ 1