[Xapian-tickets] [Xapian] #504: Add is_closed() to Database class
Xapian
nobody at xapian.org
Tue Aug 24 08:56:12 BST 2010
#504: Add is_closed() to Database class
-------------------------+--------------------------------------------------
Reporter: jcassee | Owner: olly
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Library API | Version:
Severity: minor | Keywords:
Blockedby: | Platform: All
Blocking: |
-------------------------+--------------------------------------------------
Comment(by richard):
In all the usage patterns I've used to access Xapian databases, keeping
track of "is_closed()" for a database is easy to do outside Xapian (or is
irrelevant, because the reference to the database object is dropped
immediately after calling close()), so I'm also unsure that there is much
justification for adding an is_closed() method.
However, one situation where it could be useful is for checking if an
exception has caused the database to become closed. IIRC, Some exceptions
(eg, ones which are reporting database corruption) will close the
database, but others (eg, "document not found" exceptions) will not.
Users might reasonably want to implement a generic error handler which
checks if the database is now closed, and takes some appropriate action if
so.
--
Ticket URL: <http://trac.xapian.org/ticket/504#comment:2>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list