|
From: | Per Bothner |
Subject: | Re: [Qexo-general] changes in the xml data file need to recompile? |
Date: | Mon, 02 Apr 2007 11:08:35 -0700 |
User-agent: | Thunderbird 1.5.0.10 (X11/20070302) |
Emmanuel Emmanuel wrote:
Hello, I am testing qexo in servlet.I have made a simple query file "ex.xql" that open a xml file with : doc("example.xml") and return the results.I run it with tomcat and all seems ok.But if I (just after) change the xml file within an editor and reload firefox, changes doesnt appear (or strange behavior). Does it mean that we have to "recompile" each time the code even if we only change the xml data file ?And how to make it work?
This is a problem with Qexo's implementation of the "stable" semantics of fn:doc function: XQuery requires that two calls to fn:doc(NAME) which have the same value of NAME return the same node instances. This can be a problem as you've seen. One solution is to check the time-stamp of the file (assuming the URL provides last-modified information), and re-read the file when it has changed. This still has the problem og memory leaks: old documents being kept around. A better solution is to release the cached documents by default after running each query. I need to think a little about how to do that. I'll try to figure out a solution in the next day or so. A final solution is an option to disable caching. I thought I had a work-around to directly call the gnu.kawa.xml.Document:parse method, but that doesn't seem to work for some reason. More later. -- --Per Bothner address@hidden http://per.bothner.com/
[Prev in Thread] | Current Thread | [Next in Thread] |