Hightman(马明练)
2007-Jul-29 13:06 UTC
[Xapian-discuss] Xapian::DatabaseModifiedError caused within transaction
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) What can I do for these errors?
James Aylett
2007-Jul-29 13:55 UTC
[Xapian-discuss] Xapian::DatabaseModifiedError caused within transaction
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@tartarus.org uncertaintydivision.org