Closed manjeet1198 closed 9 years ago
Can you show the code where this error originated from?
public class className{ public static Database getDB() { try (Env env = new Env("/tmp/mydb")) { try (Database db = env.openDatabase()) { return db; } } } }
from main() , Database db = className.getDB() ; db.put(bytes("Tampa"), bytes("rocks"));
You are closing both Env and Database as you return from the try-with-resources code block in getDB method.
Hi, I am using lmdbjni 0.4.4 . first time when i was putting (Key, value) in db, it was working well , but now my program is throwing LMDBException : Native object has been freed
at org.fusesource.lmdbjni.NativeObject.checkAllocated(NativeObject.java:49) at org.fusesource.lmdbjni.NativeObject.pointer(NativeObject.java:39) at org.fusesource.lmdbjni.Env.createTransaction(Env.java:444) at org.fusesource.lmdbjni.Env.createWriteTransaction(Env.java:402) at org.fusesource.lmdbjni.Database.put(Database.java:360) at org.fusesource.lmdbjni.Database.put(Database.java:352)