[Mulgara-dev] CONSTRUCT query regression?

Hugh Cayless hugh.cayless at nyu.edu
Wed Dec 1 17:38:25 UTC 2010


I've gotten a bit further with this.  What seems to be happening is the hasUnboundVar() method (which looks like it skips rows with unbound variables?) that was added in r1970 (http://www.mulgara.org/trac/changeset/1970), checks for a null object from rawAnswer.getObject.  But if you're at the end of the result set it gets instead a TuplesException, thrown from org.mulgara.store.statement.xa.TripleAVLFile.  This bubbles up, getting its message and stacktrace lost in the process, and messes up the transaction.

It looks like the logic in internalNext() just needs to be rewritten to check whether rawAnswer.next() is true before calling hasUnboundVar().

The following patch does that, and works for my current data set at least.  I don't have my head around the code base enough to know if there are other potential side effects though.

Index: GraphAnswer.java
===================================================================
--- GraphAnswer.java    (revision 1989)
+++ GraphAnswer.java    (working copy)
@@ -279,7 +279,7 @@
     // this requires that there are no unbound variables
     boolean nextResult;
     do {
-      nextResult = rawAnswer.next();
+      if (false == (nextResult = rawAnswer.next())) break;
     } while (hasUnboundVar());
     generateBlanks();
     return nextResult;

Hugh

On Nov 18, 2010, at 8:51 AM, Paul Gearon wrote:

> On Wed, Nov 17, 2010 at 9:11 PM, Hugh Cayless <hugh.cayless at nyu.edu> wrote:
>> In fact, the first thing I tried was to downgrade to 2.1.8, to no effect.
>> 
>> I can't promise I'll have time to actually fix it, but if you'll point me in the right direction code-wise, I can certainly have a look.
> 
> OK, the code for generating the XML output is found in:
> 
> src/jar/querylang/java/org/mulgara/protocol/AbstractStreamedXMLAnswer.java
> src/jar/querylang/java/org/mulgara/protocol/StreamedRdfXmlAnswer.java
> src/jar/querylang/java/org/mulgara/protocol/StreamedSparqlXMLAnswer.java
> 
> These files were updated in revision 1933, and some of them were
> updated in rev 1943. There were other files that were updated in those
> revisions as well, but they also affected JSON, and since you said
> that JSON still works, then I'll guess that the problem is restricted
> to the files I've mentioned here.
> 
> Also, do you have a trivial example that will reproduce the problem
> (or even a non-trivial one for me to reproduce it). Going through it
> with a debugger might make it apparent for me.
> 
> (Sorry I haven't had time on Mulgara this week. I caught a lingering
> flu from my kids, so when I finish work for the day I'm more inclined
> to rest than to work on Mulgara. Hopefully I'll be over it soon).
> 
> Regards,
> Paul Gearon
> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://lists.mulgara.org/mailman/listinfo/mulgara-dev

/**
 * Hugh A. Cayless, Ph.D.
 * NYU Digital Library Technology Services
 * http://papyri.info
 */





More information about the Mulgara-dev mailing list