[Xapian-tickets] [Xapian] #173: Bindings should have an explicit WritableDatabase::close() method
Xapian
nobody at xapian.org
Wed Jan 7 22:58:53 GMT 2009
#173: Bindings should have an explicit WritableDatabase::close() method
-----------------------------+----------------------------------------------
Reporter: richard | Owner: richard
Type: enhancement | Status: reopened
Priority: normal | Milestone: 1.1.0
Component: Xapian-bindings | Version: SVN trunk
Severity: normal | Resolution:
Keywords: | Blockedby:
Platform: All | Blocking:
-----------------------------+----------------------------------------------
Changes (by olly):
* status: closed => reopened
* resolution: fixed =>
Comment:
Hmm, I think we need to think about the semantics of this a bit more so
I'm going to reopen this for now to make sure we do before 1.1.0.
Declaring that calling any methods of the object (apart from to call
close() on it again) as "undefined" seems a bit unhelpful. Assuming that
this is the ISO C definition of "undefined", then that means
'''anything''' can happen. Since things like documents and iterators
implicitly access the database, I think we want to promise more than this.
It's also bad to allow access to undefined behaviour from the bindings.
I think "unspecified" is closer to what we want here - in reality, either
you'll get an exception, or it'll use some cached value (the "right"
answer) or some default behaviour (e.g. behaving as an empty database in
many ways for inmemory).
I'm not sure we want to promise to throw an exception for any use.
Perhaps we should aim for
the "right" answer or an exception? Having to gate all inmemory methods
isn't a big deal if we get a consistency win that way - it's not currently
built for performance and will be replaced by a variant of the current
disk-based backend eventually anyway.
Side issue - there's no feature test for this in the bindings!
--
Ticket URL: <http://trac.xapian.org/ticket/173#comment:12>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list