1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 23:51:47 +02:00

* Enclose most operations that update the database in transactions.

* Open all database tables (Db objects) at initialisation time, not
  every time they are used.  This is necessary because tables have to
  outlive all transactions that refer to them.
This commit is contained in:
Eelco Dolstra 2003-07-31 16:05:35 +00:00
parent 177a7782ae
commit 06d3d7355d
6 changed files with 145 additions and 96 deletions

View file

@ -9,7 +9,9 @@
void registerSuccessor(const FSId & id1, const FSId & id2)
{
nixDB.setString(noTxn, dbSuccessors, id1, id2);
Transaction txn(nixDB);
nixDB.setString(txn, dbSuccessors, id1, id2);
txn.commit();
}