I am trying to write a program that uses a Berkeley Database and i configured my database as followed :
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setType(DatabaseType.HASH);
dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(false); //tried commented this out as well
// Create the database
std_db = new Database("name.db", null, dbConfig); //delcared as a private variable
I have been spending the last hour searching the web for what happens with a key/data pair when a new key to be entered matches an existing one. According to the API the current data will be overwritten with the new data, but in my program it seems that this is not the case. Anyone know how to make it so that if im putting into a database and the key exists it will overwrite the old data?
I was thinking of just deleting the old key first and then putting in the new key/data combo, but this solution is a work-around and just adds unnecessary overhead.
Thanks in Advance :)