Re: ‘class Xapian::Database’ has no member named ‘close’

2012-08-14 Thread Justus Winter
Quoting Jani Nikula (2012-08-14 14:57:13)
> > Is close() really required though?  The comment justifies it saying
> > that:
> >
> >   Many Xapian objects hold references to the database, so merely
> >   deleting the database may not suffice to close it.  Thus, we
> >   explicitly close it here.
> >
> > but wouldn't the database get closed when the last reference gets
> > deleted anyway?

Yes, it is.

> IIRC this was related to how closing is handled in the python
> bindings.

Well this issue isn't in anyway specific to the python bindings, but
in c you can determine exactly whether a database has been closed
because this only happens if you explicitly destroy the database
object. In any garbage collected language you have to wait for the
object to be collected and this is usually not easy to detect.

So we decided to explicitly close the database and to split
..database_destroy in ..database_close and ..database_destroy later
on.

Justus


‘class Xapian::Database’ has no member named ‘close’

2012-08-14 Thread Jani Nikula
On Tue, 14 Aug 2012, Michal Nazarewicz  wrote:
> Yeah, it seems that INSTALL claims ?Notmuch will work best with Xapian
> 1.0.18 (or later) or Xapian 1.1.4 (or later)?, which doesn't seem to be
> the case.
>
> On top of that, configure does not seem to even check the version
> number.

Someone(tm) should fix both of the above.

> Is close() really required though?  The comment justifies it saying
> that:
>
>   Many Xapian objects hold references to the database, so merely
>   deleting the database may not suffice to close it.  Thus, we
>   explicitly close it here.
>
> but wouldn't the database get closed when the last reference gets
> deleted anyway?

IIRC this was related to how closing is handled in the python
bindings. The close was introduced in the commit below, not too long
ago. I just reverted that one when I had to use notmuch with ancient
xapian (but the usual disclaimers apply).

BR,
Jani.


commit cfc5f1059aa16753cba610c41601cacc97260e08
Author: Justus Winter <4winter at informatik.uni-hamburg.de>
Date:   Fri Mar 2 15:58:39 2012 +0100

Actually close the xapian database in notmuch_database_close

Formerly the xapian database object was deleted and closed in its
destructor once the object was garbage collected. Explicitly call
close() so that the database and the associated lock is released
immediately.

The comment is a courtesy of Austin Clements.

Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de>


‘class Xapian::Database’ has no member named ‘close’

2012-08-14 Thread Michal Nazarewicz
> Michal Nazarewicz  writes:
>> $ dpkg -l |grep xapian
>> ii  apt-xapian-index  0.25ubuntu2  maintenance tools for a Xapian index 
>> of Debi
>> ii  libxapian-dev 1.0.18-1 Development files for Xapian search 
>> engine l
>> ii  libxapian15   1.0.18-1 Search engine library

David Bremner  writes:
> This might be a bug with the install documentation; it could be we
> really need a later xapian to build.

Yeah, it seems that INSTALL claims ?Notmuch will work best with Xapian
1.0.18 (or later) or Xapian 1.1.4 (or later)?, which doesn't seem to be
the case.

On top of that, configure does not seem to even check the version
number.

> From memory, maybe 1.0.20 has the "close" method. 1.0.18 is pretty
> old; Debian squeeze has 1.2.3, and that must be almost 3 years old
> now.

Is close() really required though?  The comment justifies it saying
that:

Many Xapian objects hold references to the database, so merely
deleting the database may not suffice to close it.  Thus, we
explicitly close it here.

but wouldn't the database get closed when the last reference gets
deleted anyway?

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Micha? ?mina86? Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



‘class Xapian::Database’ has no member named ‘close’

2012-08-14 Thread David Bremner
Michal Nazarewicz  writes:
>
> $ dpkg -l |grep xapian
> ii  apt-xapian-index  0.25ubuntu2  maintenance tools for a Xapian index 
> of Debi
> ii  libxapian-dev 1.0.18-1 Development files for Xapian search 
> engine l
> ii  libxapian15   1.0.18-1 Search engine library


Hi Michal;

This might be a bug with the install documentation; it could be we
really need a later xapian to build. From memory, maybe 1.0.20 has the
"close" method. 1.0.18 is pretty old; Debian squeeze has 1.2.3, and that
must be almost 3 years old now.

d



‘class Xapian::Database’ has no member named ‘close’

2012-08-07 Thread Michal Nazarewicz
Hi guys,

when I'm trying to build notmuch on Ubuntu Lucid, I'm getting the
following error:

lib/database.cc: In function ?void notmuch_database_close(notmuch_database_t*)?:
lib/database.cc:767: error: ?class Xapian::Database? has no member named ?close?

I'm solving that by:

diff --git a/lib/database.cc b/lib/database.cc
index 761dc1a..fd78135 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -764,7 +764,7 @@ notmuch_database_close (notmuch_database_t *notmuch)
  * close it.  Thus, we explicitly close it here. */
 if (notmuch->xapian_db != NULL) {
try {
-   notmuch->xapian_db->close();
+   /* notmuch->xapian_db->close(); */
} catch (const Xapian::Error ) {
/* do nothing */
}

which does not seem to break anything.  The Xapian packages installed on
my machine:

$ dpkg -l |grep xapian
ii  apt-xapian-index  0.25ubuntu2  maintenance tools for a Xapian index of 
Debi
ii  libxapian-dev 1.0.18-1 Development files for Xapian search 
engine l
ii  libxapian15   1.0.18-1 Search engine library
ii  python-xapian 1.0.17-1ubuntu1  Xapian search engine interface for Python

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Micha? ?mina86? Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120807/95f32f6e/attachment-0001.pgp>


‘class Xapian::Database’ has no member named ‘close’

2012-08-07 Thread Michal Nazarewicz
Hi guys,

when I'm trying to build notmuch on Ubuntu Lucid, I'm getting the
following error:

lib/database.cc: In function ‘void notmuch_database_close(notmuch_database_t*)’:
lib/database.cc:767: error: ‘class Xapian::Database’ has no member named ‘close’

I'm solving that by:

diff --git a/lib/database.cc b/lib/database.cc
index 761dc1a..fd78135 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -764,7 +764,7 @@ notmuch_database_close (notmuch_database_t *notmuch)
  * close it.  Thus, we explicitly close it here. */
 if (notmuch-xapian_db != NULL) {
try {
-   notmuch-xapian_db-close();
+   /* notmuch-xapian_db-close(); */
} catch (const Xapian::Error error) {
/* do nothing */
}

which does not seem to break anything.  The Xapian packages installed on
my machine:

$ dpkg -l |grep xapian
ii  apt-xapian-index  0.25ubuntu2  maintenance tools for a Xapian index of 
Debi
ii  libxapian-dev 1.0.18-1 Development files for Xapian search 
engine l
ii  libxapian15   1.0.18-1 Search engine library
ii  python-xapian 1.0.17-1ubuntu1  Xapian search engine interface for Python

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +email/xmpp: m...@google.com--ooO--(_)--Ooo--

pgprHq4rmpe6p.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch