View Single Post
  #1 (permalink)  
Old 10-23-2004
dragzhb dragzhb is offline
Registered User
 
 
Join Date: Jul 2004
Posts: 63
Send a message via Yahoo to dragzhb
-->
Can't insert a record when this record has been in db

HI bernard:
When I insert one record into db , but it can't be inserted when this record has been in db.
I think ICE insert db using Berkeley DB's DB->put with flag DB_NOOVERWRITE.
this time I insert record into db must use following steps:

_mapPtr->erase(obj.ID);
_mapPtr->insert(make_pair(obj.ID, obj));

but it's very slowly when db has many records.

How can quickly insert records when db has the rcord or has no the record?

Could you have an option to insert record using Berkeley DB's default behavior

The default behavior of the DB->put function is to enter the new key/data pair, replacing any previously existing key if duplicates are disallowed, or adding a duplicate data item if duplicates are allowed.

thanks


Last edited by dragzhb : 10-23-2004 at 08:01 AM.
Reply With Quote