[haiku-gsoc] Re: [hcd09] Subsequent BQueries Fail

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Mon, 22 Jun 2009 10:54:12 +0200 CEST

Ankur Sethi <get.me.ankur@xxxxxxxxx> wrote:
> I'm having some troubles with BQuery.
> 
> I'm using the BVolumeRoster to retrieve all mounted volumes which
> respond to queries. Since one live BQuery can be run on only one
> volume, I create as many BQuery objects as there are (supported)
> volumes. The target of all these BQuery objects is an instance of
> Feeder (Feeder is my BLooper subclass). The problem is that I can
> retrieve the static entries and receive B_QUERY_UPDATE messages only
> from the very first BQuery. The remaining BQueries simply fail to
> Fetch().

It's certainly possible that there is a bug in Haiku that prevents this 
from working. To check that, you could see how Tracker queries behave 
over more than one volume. If those are working, the problem is 
obviously on your side of things. If you cannot find the culprit 
yourself, posting the code would be helpful, then.

> Strangely enough, Fetch() does not return any of the error constants
> mentioned in the BeBook
> (http://www.haiku-os.org/legacy-docs/bebook/BQuery.html#BQuery_Fetch).
> > The value it returns is -2147459062. Has the API changed?

We indeed prefer to return useful error codes, not only the ones 
mentioned in the BeBook. You should rarely have the need to check for a 
specific error code (besides B_ENTRY_NOT_FOUND, maybe) - usually, code 
is broken when it does that.
You can use the "error" command with that number, and should get the 
clear text error back (when there is one defined).

Bye,
   Axel.


Other related posts: