index/store: simplify transaction handling

only have transactions for indexing, and make it opportunistic. All other ops do
not use transactions.
This commit is contained in:
Dirk-Jan C. Binnema
2021-10-20 17:18:51 +03:00
parent 3dd721d5a3
commit 89014ecd06
4 changed files with 69 additions and 42 deletions

View File

@ -279,11 +279,17 @@ class Store {
bool empty() const;
/**
* Commit the current group of modifications (i.e., transaction) to disk;
* This rarely needs to be called explicitly, as Store will take care of
* it.
* Start a Xapian transaction, opportunistically. If a transaction
* is already underway, do nothing.
*/
void commit();
void begin_transaction();
/**
* Commit the current group of modifications (i.e., transaction) to
* disk, opportunistically. If no transaction is underway, do
* nothing.
*/
void commit_transaction();
/**
* Get a reference to the private data. For internal use.