BerkeleyDB - Re: How to use transactions with cursors?

Posted on Thu May 31 21:38:50 2007 by pmarquess in response to 5272 (See the whole thread of 2)
Re: How to use transactions with cursors?
Here is the idiom translated
$env = new BerkeleyDB::Env... $db = tie %hash, BerkeleyDB::Hash,... -Env => $env, ... $txn = $env->txn_begin() $db->Txn($txn); $cursor = $db->create_cursor(); # do some stuff undef $cursor; $txn->commit();
The secret is this line
$db->Txn($txn);
It will assocuiate the transaction with all operations on the database behind the scenes.
Paul
Write a response