recovery question -
07-06-2005
, 01:36 PM
the following little piece of code works fine. Now i want to undo the
"myDb.puttid,&key,&data,0)", which means i don't want to store the data
after i done the .put. I know I can delete the record, but can i use
recovery or other way to achieve the undo. Could anyone help me,
thanks!
************************************************** *********
u_int32_t env_flags=DB_CREATE|DB_INIT_MPOOL|DB_INIT_TXN;
u_int32_t db_flags=DB_CREATE
DbEnv my Env(0);
myEnv.open("env", env_flags,0);
DbTxn *tid;
myEnv.txn_begin(NULL,&tid,0);
Db myDb(&myEnv,0);
myDb.open(tid,"../test_db/myDb.db",NULL,DB_BTREE,db_flags,0);
int i=1;
char *a="hello world"
Dbt key(&i, sizeof(int));
Dbt data(a, strlen(a)+1);
myDb.put(tid,&key,&data,0);
tid->commit(0);
***************************************** |