Hi Chris,
I will have a look at this method when I get some time, it is possibly not
Thread safe, we will have to see.
For now I suggest doing something this:
public static synchronized Node getContentAsDOM(XMLResource res) {
return res.getContentAsDOM();
}
or perhaps better:
public static final Node getContentAsDOM(XMLResource res) {
synchronized(res) {
return lock.getContentAsDOM();
}
}
And then use this method instead of XMLResource.getContentAsDOM(); until a
fix becomes available.
I think it is also possible you are not using Sedna XML:DB in the way it
was intended to be used. If you are executing multiple queries in
different Servlet Requests (i.e. Different Threads), you should really be
making use of multiple DatabaseManager.getCollection(), not keeping one
Collection <connection> and re-using that. It has a built in sophisticated
thread pooling manager for this very purpose, and will remove unnecessary
complications for yourself (which you appear to be running into) please
read the documentation for more details.
Please understand I am not paid to do any support for this, this is the
nature of free software.
Regards,
Charles
> I am using the following code to query Sedna using a servlet:
>
> ArrayList<Node> nodeList = new ArrayList<Node>();
> for(int i=0;i<subNodeIds.size();i++){
> ResourceSet resSet = queryService.queryResource(modelId,
> XMLDBQuery.MODEL_ROOT_NODES_XPATH);
> ResourceIterator iter = resSet.getIterator();
> while(iter.hasMoreResources()){
> XMLResource resource = (XMLResource) iter.nextResource();
> Document doc = (Document) resource.getContentAsDOM();
> nodeList.add(node);
> }
>
>
> If I have only one thread running, the code and query work fine. However
> when I try to load test with multiple simultaneous requests, some of the
> requests generate the following error:
>
> org.xmldb.api.base.XMLDBException:
> at net.cfoster.sedna.xmldb.v.getContentAsDOM(Unknown Source)
>
> Thanks,
>
> Chris Tindal
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensign option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Sedna-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sedna-discussion
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion