lmdbjava: Exception when using parent transactions

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.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (24 by maintainers)

Commits related to this issue

Most upvoted comments

Are we OK to close this ticket now PR #36 is closed?