[PATCH] lib: Simplify close and codify aborting atomic section
Austin Clements
amdragon at mit.edu
Mon Sep 22 11:50:50 PDT 2014
Quoth W. Trevor King on Sep 22 at 9:59 am:
> On Mon, Sep 22, 2014 at 11:43:35AM -0400, Austin Clements wrote:
> > This patch simplifies notmuch_database_close to just call
> > Database::close. This works for both read-only and read/write
> > databases, takes care of committing changes, unifies the exception
> > handling path, and codifies aborting outstanding transactions.
>
> If we're dropping the flush call here, where will it be triggered
> instead? We'll need to flush/commit our changes to the database at
> some point before closing. Do clients now need an explicit
> flush/commit command (explicit, client-initiated flushes sound like a
> good idea to me).
The call to Database::close implicitly flushes/commits, as mentioned
in the comment in the patch, so there's no need for any new APIs or
client changes. The call to Database::flush in notmuch_database_close
was entirely redundant with the call to Database::close.
More information about the notmuch
mailing list