Skip to content

Exception when using parent transactions #35

Description

@pstutz

I can't get parent transactions to work. This is the Scala code I run:

object ParentTxnProblem extends App {
  val db =  org.lmdbjava.Env.create
  val testFolder = new java.io.File("./test")
  testFolder.mkdir
  val env = db.open(testFolder)
  val parentTxn = env.txnRead
  val childTxn = env.txn(parentTxn, org.lmdbjava.TxnFlags.MDB_RDONLY_TXN)
}

This is the output of running the above with the current 0.0.5-SNAPSHOT from Sonatype:

Exception in thread "main" org.lmdbjava.LmdbNativeException$ConstantDerviedException: Platform constant error code: EINVAL (22)
	at org.lmdbjava.ResultCodeMapper.checkRc(ResultCodeMapper.java:113)
	at org.lmdbjava.Txn.<init>(Txn.java:73)
	at org.lmdbjava.Env.txn(Env.java:274)
	at last line of example code above

Am I doing something wrong or is there an issue with parent transactions? Thanks a lot for your time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions