[Xapian-discuss] TCL Binding working, but db_lock doesn't get removed?

Olly Betts olly at survex.com
Thu Oct 21 23:05:42 BST 2004


On Thu, Oct 21, 2004 at 02:03:31PM -0700, Eric Parusel wrote:
> Only after the script ends, next time I try to run it, it complains 
> about the lock present (the db_lock file is in the directory).
> 
> I have to manually delete the db_lock to be able to run the script again 
> it seems.

Sounds like the destructor for Xapian::WritableDatabase isn't being run.

> Is there a particular way I should be destroying the WritableDatabase 
> object?

For Tcl, I really don't know - sorry!  Perhaps Michael will be able to
suggest something.

It's not just the lock file - unless you explicitly flush before the
script exits, you're rely on the destructor to flush the last batch
of changes.

> db replace_document 1 doc
> 
> Where db is a WritableDatabase object and
> where doc is a Document object
> 
> ...as a way of setting the docid (I already have a system of unique 
> idnumbers starting from 1, I assume a docid can handle any positive 
> signed int32?), am I doing this correctly?

Any positive unsigned 32 bit integer is fine (0 isn't).

The compression schemes used in the tables assume the docids aren't
sparse.  Something like an auto-incrementing uid field from a SQL
database should work well.  Something like using document hashes or
machine IP addresses as the docids probably wouldn't (although there's
also overhead for storing and using a UID term...)

Cheers,
    Olly



More information about the Xapian-discuss mailing list