[
https://issues.apache.org/jira/browse/WSCOMMONS-362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648171#action_12648171
]
Daniel Kulp commented on WSCOMMONS-362:
---------------------------------------
There are two parts of this:
1) The getElementsByTagNameNS probably is just a List<Element> type thing.
You could wrapper that list with something that implements NodeList that IS
threadsafe if you want to keep API compatibility.
2) The AppIno/Documentation thing - there are two issues with the current
NodeList thing:
a) it holds onto the original Elements/Nodes which has a side affect of
holding onto the entire DOM document. Thus, if your schema has any
documentation things, the DOM will never get garbage collected.
b) The thread safety issue.
For (2), I would SUGGEST creating a DocumentFragment and cloning the elements
(deep clone) into it. Storing that in the node. That would solve the DOM
memory leak issue. For 1.4.x, you could return an object that implements
NodeList that wrappers the DocFrag in a threadsafe way. For 2.x, that could
be fixed to be a bit cleaner. (List<Element>) or even return the DocFrag
directly.
> SchemaBuilder not thread safe
> -----------------------------
>
> Key: WSCOMMONS-362
> URL: https://issues.apache.org/jira/browse/WSCOMMONS-362
> Project: WS-Commons
> Issue Type: Bug
> Components: XmlSchema
> Reporter: Daniel Kulp
>
> If the same DOM is passed into different SchemaBuilders, SOMETIMES an
> exception is thrown.
> The processExtensibilityComponents method uses a NodeList which is not thread
> safe in Xerces.
> See:
> http://mail-archives.apache.org/mod_mbox/xerces-j-users/200707.mbox/%3C1185522253.5789.186.camel%40localhost%3E
> The patch in WSCOMMONS-361 fixes that method. However, the call to
> getElementsByTagNameNS in handleSimpleContentRestriction has the same issue
> and the markup stuff (handleAppInfo and handleDocumentation) would as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.