|
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
|