Project

Profile

Help

Configuration issues

Added by Anonymous almost 16 years ago

Legacy ID: #5145364 Legacy Poster: tracknerd (tracknerd2003)

The problem I am trying to solve is I have a directory full of xml files and a directory full of xquery files to run against each xml file. I load all the xquery files into memory and compile using a new Configuration object for each StaticQueryContext. Then I go through each of the xml documents in the directory and make a new DynamicQueryContext with a new Configuration object. Then evaluate the compiled xquerys against that DynamicQueryContext. Everything seemed to be working fine, but now I am seeing that the evaluations are coming out wrong sometimes. I found that if I use the same Configuration object for the DynamicQueryContext and the StaticQueryContext everything works fine, but the issue is I do not want to have to recreate the DynamicQueryContext for each xquery. I am guessing this could be cause by the name pool, but that is just a guess. Thanks


Replies (2)

RE: Configuration issues - Added by Anonymous almost 16 years ago

Legacy ID: #5145418 Legacy Poster: Michael Kay (mhkay)

Yes, you must use the same Configuration when compiling a query and when running it (and when building the source document). Saxon has quite a few checks for this in place, but from the information you gave I found a path where it isn't being checked, and is therefore likely either to crash out with a NamePool error or (if you are unlucky) give incorrect results. (Actually, it doesn't have to be the same Configuration. Two different Configurations sharing the same NamePool would be OK. But there's little benefit in doing that unless you really want the Configuration settings to be different.) In your case I would recommend running the whole workload using a single Configuration object. Michael Kay http://www.saxonica.com/

RE: Configuration issues - Added by Anonymous almost 16 years ago

Legacy ID: #5145504 Legacy Poster: tracknerd (tracknerd2003)

Is the Configuration Object thread safe? I am running 10 threads to perform this and was wondering if I could just create a static Configuration object to share between the threads?

    (1-2/2)

    Please register to reply