aboutsummaryrefslogtreecommitdiff
path: root/lib/database.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-05-18 08:03:22 -0300
committerDavid Bremner <david@tethera.net>2021-06-27 13:58:17 -0300
commit65f923219e08193d590bec35e2c3995dc6a19395 (patch)
treeec745faa8ed8db5864a6cf8ac7575da8ee16107a /lib/database.cc
parent49893c2c617e0d6874bb9670faa83ddf2324d721 (diff)
database/close: remove misleading code / comment
Unfortunately, it doesn't make a difference if we call cancel_transaction or not, all uncommited changes are discarded if there is an open (unflushed) transaction.
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 6db82373..aed05388 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -502,17 +502,9 @@ notmuch_database_close (notmuch_database_t *notmuch)
* close it. Thus, we explicitly close it here. */
if (notmuch->open) {
try {
- /* If there's an outstanding transaction, it's unclear if
- * closing the Xapian database commits everything up to
- * that transaction, or may discard committed (but
- * unflushed) transactions. To be certain, explicitly
- * cancel any outstanding transaction before closing. */
- if (_notmuch_database_mode (notmuch) == NOTMUCH_DATABASE_MODE_READ_WRITE &&
- notmuch->atomic_nesting)
- notmuch->writable_xapian_db->cancel_transaction ();
-
/* Close the database. This implicitly flushes
- * outstanding changes. */
+ * outstanding changes. If there is an open (non-flushed)
+ * transaction, ALL pending changes will be discarded */
notmuch->xapian_db->close ();
} catch (const Xapian::Error &error) {
status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;