Re: [bdbxml] hasNext() fails on an empty result
George Feinberg <[email protected]> Mon, 15 Aug 2005 15:17:57 -0400
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
For the list, The bug here was that XmlResults.hasNext() and XmlResults.peek() do not properly catch and re-thrown exceptions from the internals of the Pathan library, so they get passed through, uncaught. This only happens when you are using those interfaces with Lazy results. The workarounds are to either use eager results, or to avoid those two interfaces (just use next()) with lazy results. George > > >> Hi all, >> >> in my java code i get the following exceptions when i call hasNext >> () on a XMLResult object that is returned from a query: >> >> com.sleepycat.dbxml.XmlException: Uncaught exception from C++ API: >> Unknown error, errcode = INTERNAL_ERROR >> at com.sleepycat.dbxml.dbxml_javaJNI.XmlResults_hasNext(Native >> Method) >> at com.sleepycat.dbxml.XmlResults.hasNext(XmlResults.java:49) >> >> >> The query is well formed but it (intentionally) returns 0 objects. >> >> Is this behaviour a bug or a feature? >> > > That sort of exception is never a feature. > > What version of BDB XML are you using, and platform? > Is this on all empty query results? A simple test program is often > helpful, in case there is something subtle going on. > > Regards, > > George > ------------------------------------------ To remove yourself from this list, send an email to [email protected]