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:
parent
177a7782ae
commit
06d3d7355d
6 changed files with 145 additions and 96 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue