[Xapian-discuss] Filelocks not released

Niels Boldt nielsboldt at gmail.com
Wed Dec 2 10:34:38 GMT 2009


Hi,

Richard: Thanks for your answers. I suspected that the issue was related to
destruction vs dispose vs finalization. We will take a look into this and
see if we can solve it somehow

Charlie: Thanks for your answer as well. I can comfirm that we are using the
C# bindings

Best Regards
Niels

On Wed, Dec 2, 2009 at 10:38 AM, Richard Boulton <richard at tartarus.org>wrote:

> 2009/12/2 Niels Boldt <nielsboldt at gmail.com>:
> > But this procedure keeps giving us errors because xapian does not release
> > the locks it holds on the files, so we cannot get access to copy them. Is
> it
> > not sufficient to call 'Dispose'. Should the object also be finalized
> before
> > the locks on the files are release
>
> This is a familiar problem, unfortunately.  The problem is that
> Xapian's databases don't release the lock by default until the
> underlying C++ database object is deleted.  In garbage collected
> languages, this is a particular problem, because the time at which the
> C++ object is freed is not obvious in advance.  In addition, Xapian
> keeps references to the database from some of the other objects (eg, a
> Document opened from the database keeps a reference to the database),
> so the C++ database internals aren't freed until all such references
> have gone away (by the Document being deleted).
>
> The good news is that this is fixed in the 1.1.0 release series by
> adding a "close" method to the Database object.  The bad news is that
> this is a development release series, and we're not quite ready to
> release the 1.2.0 stable release based on it (shouldn't be long now,
> though!)
>
> finalizing the object might help, but I'm not familiar enough with
> .Net to know whether that's something you can force, and whether it
> will force the underlying C++ object to be deleted.  You'd need to
> make sure all objects derived from the Database object were finalised,
> too, as noted above, so any solution based on this won't be as
> reliable as using the close() method in the 1.1.x release series.
>
> --
> Richard
>
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>



-- 
BinaryConstructors ApS
Vestergade 10a, 4th
1456 Kbh K
Denmark
phone: +4528138757
web: http://www.binaryconstructors.dk
mail: nb at binaryconstructors.dk
skype: nielsboldt


More information about the Xapian-discuss mailing list