Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

createTreeMap() does not allow to load existing data #86

Closed
tbocek opened this Issue · 2 comments

2 participants

@tbocek

The following testcase fails:

@Test
public void loadDB()
{
String dirName = "/tmp/jdbm";
DB db = DBMaker.openFile(dirName).disableTransactions().make();
Map dataMap = db.createTreeMap("test-map");
dataMap.put("hallo", "test");
db.close();
db = DBMaker.openFile(dirName).disableTransactions().make();
dataMap = db.createTreeMap("test-map");
}

java.lang.IllegalArgumentException: Object with name 'test-map' already exists
at org.apache.jdbm.DBAbstract.assertNameNotExist(DBAbstract.java:349)
at org.apache.jdbm.DBAbstract.createTreeMap(DBAbstract.java:243)
at org.apache.jdbm.DBAbstract.createTreeMap(DBAbstract.java:234)
at org.apache.jdbm.DBAbstract.createTreeMap(DBAbstract.java:31)
...

The JavaDoc says "Creates or load existing Primary TreeMap which persists data into DB.", however, I can create but not load.

@jankotek
Owner

Javadoc is wrong, use DB.get().

@jankotek
Owner

Javadoc fixed

@jankotek jankotek closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.