Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dbi creation within transaction not supported #192

Closed
@fbiricotti

Description

@fbiricotti

The APIs for creating a database (openDbi) don't take a transaction as input parameter (it's generated internally and immediately committed). This code works:

    Dbi<ByteBuffer> dbi = env.openDbi("TEST", new DbiFlags [] { DbiFlags.MDB_CREATE });    Txn<ByteBuffer> txn = renv.txnWrite();    dbi.put(txn, key, val);    txn.commit();

This code DOES NOT:

    Txn<ByteBuffer> txn = repoEnv.txnWrite();    Dbi<ByteBuffer> dbi = repoEnv.openDbi("TEST", new DbiFlags [] { DbiFlags.MDB_CREATE });    dbi.put(txn, key, val);    txn.commit();

by throwing this exception:

Exception in thread "main" org.lmdbjava.LmdbNativeException$ConstantDerivedException: Platform constant error code: EINVAL Invalid argument (22)
at org.lmdbjava.ResultCodeMapper.checkRc(ResultCodeMapper.java:114)
at org.lmdbjava.Dbi.put(Dbi.java:411)
at test.TestMain.main(TestMain.java:34)

This seems to be a blocking issue in a complex application where databases may be require to be created on-demand while a write transaction is already up and running. Or there is an alternative ? Please note that the native LMDB API for opening/creating a database do require a transaction., why not exposing it as parameter?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp