[Xapian-discuss] how to catch Xapian::DatabaseModifiedError in perl?

Andreas Marienborg andreas at startsiden.no
Wed Jan 30 09:56:30 GMT 2008


On Jan 26, 2008, at 7:15 PM, Markus Wörle wrote:

> Hello,
>
> The pod-documentation of Database.pm says:
> > reopen
> >
> > This re-opens the database(s) to the latest available version(s).  
> It can be
> > used either to make sure the latest results are returned, or to  
> recover from
> > a Xapian::DatabaseModifiedError.
>
> I really would like to do that, but as soon as this exception  
> occures my applications dies with a SIGABRT.
>
> Is there any posibility to catch a Xapian::DatabaseModifiedError  
> with Search::Xapian in Perl?
>
> At the moment I need reopen() the database before each query, which  
> seems the only way to handle concurrent reading and updating in with  
> perl, but it feels not very neat.
>
> Regards,
> mrks

I have the same issue, and have started creating a patch for  
Search::Xapian in bug #230[1].

This bug is meant to be for the maintainer to use before releasing the  
packages, as it generates the code from xapian-core exceptions, rather  
than hardcode each exception in the bindings. I run a patched version  
of 1.0.4 in production and catch Search::Xapian::DatabaseModifiedError  
succesfully there with the exception-classes and patched Enquire.xs.


- andreas


[1] http://www.xapian.org/cgi-bin/bugzilla/show_bug.cgi?id=230


More information about the Xapian-discuss mailing list