-
Notifications
You must be signed in to change notification settings - Fork 923
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for "Duplicate RW transaction" LMDB exception.
Although LMDB supports concurrent RO and RW transactions (but no more than one writer), the existing lmdb access code here seems to be written assuming an LMDB RW transaction is not allowed to coexist with any other transaction, even RO ones. The logic to decide whether a transaction would be RO or RW was relying upon the way the database was opened at mdb_dbi_open() time, which turns out to be (almost always) read-write, despite the kind of the upcoming requests. We now pass a boolean further in MDBEnv::openDB() to specify the intent of the operation, rather than trusting the shared environment only. This allows us to build more MDBROTransaction objects where MDBRWTransaction objects would have been used previously The existing test would raise an exception, should there be existing RO transactions.
- Loading branch information
1 parent
0ce41bc
commit e900845
Showing
3 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters