On Tue, Jan 03, 2006 at 12:15:33PM -0200, Rafael Jorge
wrote:> Hi, I'm getting this error with Omega:
> '''Exception in Xapian: The revision being read has been
discarded - you
> should call Xapian::Database::reopen() and retry the
operation'''
When you open a Quartz database for reading, you open a particular revision.
If the database is updated twice while you still have it open, then that
revision will be overwritten (at least in part). Quartz detects when
this happens, and throws DatabaseModified error.
As the exception message hints, you need to catch this exception and
call reopen() on the database, then retry the failed operation. Omega
doesn't currently do this though because it doesn't hold databases open
so shouldn't run into the problem. If you're seeing it, then you're
updating the database at such a frequency that a search takes longer
than two flushed updates (or the database is corrupted such that quartz
thinks this is happening perhaps).
If you're hammering in updates every few seconds, a better fix is
probably to batch them up and flush once a minute (say).
Flint currently works the same way, but the plan is that readers will
be able to signal which revisions are in use so a writer can preserve
them and avoid this issue.
Cheers,
Olly