Premature exit from XQuery streaming
When a query is evaluated using XQueryEvaluator.iterator(), there is no way of indicating that no further results are required (it returns a standard Java iterator, which does not have a close() method).
This is significant when streaming using saxon:stream(), because this involves a separate parser thread that is supplying data incrementally via a shared buffer. This thread remains in suspended animation waiting for the query thread to read data out of the shared buffer to make room for more data.
Reported by Gunther Rademacher on saxon-help list
#1 Updated by Michael Kay about 4 years ago
- Status changed from In Progress to Resolved
For 9.5, I have added a close() method to XdmSequenceIterator; the result of XQueryEvaluator.iterate() needs to be cast to XdmSequenceIterator in order to invoke this method. I have tested that this works.
For 9.6, I will change the signature of XQueryEvaluator so that it declares XdmSequenceIterator as the return type.
Please register to edit this issue