* In normaliseFState(), wrap registration of the output paths and the

normal form in a single transaction to ensure that if we crash,
  either everything is registered or nothing is.  This is for
  recoverability: unregistered paths in the store can be deleted
  arbitrarily, while registered paths can only be deleted by running
  the garbage collector.
This commit is contained in:
Eelco Dolstra 2003-08-01 15:41:47 +00:00
parent d99d04e644
commit c95b4ad290
6 changed files with 44 additions and 28 deletions

View file

@ -44,7 +44,10 @@ FSId writeTerm(ATerm t, const string & suffix, FSId id)
// debug(format("written term %1% = %2%") % (string) id %
// printTerm(t));
registerPath(path, id);
Transaction txn(nixDB);
registerPath(txn, path, id);
txn.commit();
return id;
}