[Xapian-devel] buffered tables, sessions, and transactions

James Aylett james-xapian at tartarus.org
Wed May 19 13:25:22 BST 2004


On Wed, May 19, 2004 at 01:15:50PM +0100, Olly Betts wrote:

> I've noticed a slight wrinkle - currently if a database is destroyed
> with an active transaction, cancel_transaction is called.  Without
> this method, if an error is thrown part way through a transaction,
> either we apply the whole lot, or lose everything since the last call to
> flush() (explicit or implicit).  That could be several transactions, so
> at least this preserves atomicity better than just flushing.
> 
> Perhaps we should *always* require a call to flush() (or a new close()
> method) before a database is destroyed?  At present, any errors thrown
> by the implicit flush() in the destructor are caught and ignored, which
> isn't ideal at all.
> 
> However, that's an API change, and seems to be deliberately setting a
> trap for the unwary...

Would you be talking about only requiring flush() if there is a
transaction in progress? I'd be heavily opposed to the requirement
outside transactions, because it run contrary to how you'd expect most
bindings languages to behave, even if you could expect it for a C++
library.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org




More information about the Xapian-devel mailing list