[Xapian-discuss] Fwd: inmemory throwing DatabaseModifiedError

Andrew Betts andrew.betts at ft.com
Tue Feb 11 08:12:25 GMT 2014


Hi,

I have a weird situation with an inmemory database, which appears to be
throwing a DatabaseModifiedError.  I had a look at the Xapian test code and
found a comment that said:

// Inmemory never throws DatabaseModifiedError

But my code (PHP bindings):

$xapian_database = Xapian\Xapian::inmemory_open();
$xapian_database->add_document($xdoc);
$xapian_database->commit();

Is throwing:

DatabaseModifiedError: The revision being read has been discarded - you
should call Xapian::Database::reopen() and retry the operation

On the add_document line.  Here's a backtrace:

#0: writabledatbase_add_document() in
/vendor/ftlabs/xapian-query/src/Xapian/XapianWritableDatabase.php:40
#1: add_document() in /app/classes/XapianDatabases:111
#2: filterQueriesForPost() in
/app/classes/indexingjobs/XapianStreamFinder.php:38

Any idea why this error would be thrown by an inmemory database?  As I
understand it, there should be no reason why this database is subject to
interference outside of the process that creates it.  In practice, these
errors are occurring when we have a large number of inmemory databases
being created and destroyed at the same time, so is there any way they
could be clashing?

Andrew

-- 

------------------------------
This email was sent by a company owned by Pearson plc, registered office at 
80 Strand, London WC2R 0RL.  Registered in England and Wales with company 
number 53723.


More information about the Xapian-discuss mailing list