* 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:
+3
-1
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user