Great – thanks a lot for resolving this so quickly! I can confirm that the fix works as expected

in my environment.

 

Best regards

Gunther

 

 

From: Michael Kay [mailto:mike@saxonica.com]
Sent: Mittwoch, 26. Februar 2014 17:23
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] How to exit prematurely from iterating saxon:stream results?

 

 

Resolved as suggested: see https://saxonica.plan.io/issues/2016

 

Michael Kay

Saxonica

 

On 26 Feb 2014, at 15:46, Michael Kay <mike@saxonica.com> wrote:



I think you've exposed a gap in the interface design here. Because this method returns a standard Java Iterator (rather than a Saxon SequenceIterator), there is no method available to close it. The only workaround I can think of is to dive down from the XQueryExecutable to the underlying XQueryExpression, and use the lower-level methods that return a SequenceIterator.

 

The close() method is no use, it's only of relevance when the XQueryEvaluator is acting as the Destination of another query or stylesheet.

 

I'm thinking I will probably expose the fact that XQueryEvaluator.iterator() returns an XdmSequenceIterator, and give this a close() method.

 

Michael Kay

Saxonica

 

 

On 26 Feb 2014, at 10:47, Rademacher, Gunther <Gunther.Rademacher@softwareag.com> wrote:



Some more testing on the code that I sent earlier this week (see “Question on streaming via s9api”)

revealed the fact that it leaves one thread waiting, if the iteration loop exits prematurely.

 

This can be reproduced like this:

 

           Iterator<XdmItem> xdmItemIterator = xqueryEvaluator.iterator();          

           xdmItemIterator.next();

           xqueryEvaluator.close();

 

I was hoping to free resources associated to the iteration by calling xqueryEvaluator.close(), but

no success. Is there a way to get rid of that thread?

 

Thanks

Gunther

 

 

Software AG – Sitz/Registered office: Uhlandstraße 12, 64297 Darmstadt, Germany – Registergericht/Commercial register: Darmstadt HRB 1562 - Vorstand/Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman), Dr. Wolfram Jost, Arnd Zinnhardt; - Aufsichtsratsvorsitzender/Chairman of the Supervisory Board: Dr. Andreas Bereczky -http://www.softwareag.com

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help

 

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help