Can't stop a runaway XPath expression

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Can't stop a runaway XPath expression

Post by dsewell »

Just now, by mistake I entered an XPath expression like this to search in a large XML document:

Code: Select all

//distinct-values(//myElement)
when I meant to put

Code: Select all

distinct-values(//myElement)
Because of the mistake, oXygen is recursing through everything in the document tree and using 100% CPU while doing it. The program is unresponsive and I either can't click on the "STOP" square, or it isn't doing anything.

In a situation like this, is there anything that can be done to force a stop to the operation, other than killing oXygen? (I am running it under OS X, so the nuclear option is Force Quit.)
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Re: Can't stop a runaway XPath expression

Post by dsewell »

(After about 10 minutes, the operation finally stopped with an out-of-memory error and I was able to save the file and proceed.)
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Can't stop a runaway XPath expression

Post by adrian »

Hi,

If you use the XPath toolbar, a red square (stop button) appears on the right side off the XPath combo box (in place of the list expand widget).
If you have used the XPath/XQuery Builder view the Execute XQuery button from its toolbar turns into a stop button.

In practice, it's possible that by the time you decide to stop it, the XPath execution has already generated too many results and the application is already running low on memory and the UI is unresponsive. If that's the case and you have unsaved files, it's best to let it run its course and it will eventually run out of Java memory, show you the memory error and become responsive again enough so that you can save your files and restart.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Re: Can't stop a runaway XPath expression

Post by dsewell »

Right, in my case the application was unresponsive by the time I hit the stop button. I guess the lesson is to be more careful in constructing XPath/XQuery expressions with large files/projects.
Post Reply