try
{ key = key.trim();
DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
DatabaseEntry dbData = new DatabaseEntry();
data.getBdbBinding().objectToEntry(data, dbData);
OperationStatus ost = (dups) ? getCurrentDB().put(null, dbKey, dbData):
getCurrentDB().putNoOverwrite(null, dbKey, dbData);
if (ost != OperationStatus.KEYEXIST) valid = true;
}
catch (DatabaseException e)