Markus Wörle
2008-Jan-26 18:15 UTC
[Xapian-discuss] how to catch Xapian::DatabaseModifiedError in perl?
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
Andreas Marienborg
2008-Jan-30 09:57 UTC
[Xapian-discuss] how to catch Xapian::DatabaseModifiedError in perl?
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, > mrksI 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