[Xapian-discuss] Perl XS bindings, postlist_begin

Francis Irving francis@flourish.org
Sat, 29 May 2004 09:53:28 +0100

On Fri, May 28, 2004 at 03:16:10PM +0100, Olly Betts wrote:
> On Fri, May 28, 2004 at 02:59:51PM +0100, Francis Irving wrote:
> > Something bad is happening, but I don't quite understand why.
> > Exception: Db block overwritten at ./index.pl line 68, <F> line 2002.
> This isn't bad.
> Xapian supports multiple readers and one writer concurrently.  But if
> the writer commits two or more batches of changes, a reader will get
> this exception.  The issue is that a reader needs a consistent snapshot
> of the database - for the usual model of searching while indexing, it's
> usually enough to keep one old version around.
> If you get that exception, you can just call "reopen" on the reader to
> reopen it at the latest revision, and repeat the operation(s) you were
> doing.
> That error message ought to be reworded to explain better what's
> actually happened and point to reopen().

Ah, I hadn't realised what a "batch" of changes is.  I'd assumed that
a batch was until a WritableDatabase objects was destroyed, but it
seems to happen more often than that.

Also, I haven't delved into the use of set_error_handler in PHP 4.
There are no exceptions yet, so errors which aren't return codes are
awkward to handle.

Just had a thought... One way to improve documentation without much
effort would be to have user comments on the online docs, like the PHP
and MySQL websites.  If each Xapian function was separately
commentable website, then people using it would add explanations and

This would be both directly helpful, and the material could be
returned back into the documentation proper and the comments removed.
Easier than allocating separate time to documentation writing, and
trying to second guess what people want to know.

Instead of comments, a Wiki could do this as well - and I mean a wiki
where people edit the documentation itself, not one with no initial

Undemocratic Europe.  Fix it.  Vote Martin Bell.  http://www.bellforeurope.org.uk