[Xapian-discuss] Xapian::DatabaseModifiedError caused within transaction

James Aylett james-xapian at tartarus.org
Sun Jul 29 13:54:45 BST 2007


On Sun, Jul 29, 2007 at 08:04:48PM +0800, Hightman(马明练) wrote:

> For some reasons, my document was updated by users. When the update
> action(delete + add) multiple called within one transaction, There
> is DatabaseModifiedError taken place always. the produced code such
> as:
> 
> database.begin_transaction();
> ..
> database.delete_document(unique_term);
> database.add_document(doc1);
> ..
> database.delete_document(unique_term);
> database.add_document(doc2);
> ..
> database.commit_transaction();
> 
> When after these codes, the databases(flint backend) must be broken
> for 'DatabaseModifiedError' (The revision being read has been
> discarded - you should call Xapian::Database::reopen() and retry the
> operation)

I /think/ I know why this doesn't work - does it happen if you do
replace_document() instead?

J

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



More information about the Xapian-discuss mailing list