You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Siddangouda Sankanagouda <go...@calific.com> on 2001/01/31 19:08:49 UTC

Thread safety

Hi,

Anybody knows 'importNode' of DocumentImpl is thread safe. When mutiple
threads calls importNode of DocumentImpl and trying to import the same Node
I am getting this error. But with only one thread running,it works fine.
Please help me..


org.w3c.dom.DOMException: DOM002 Illegal character in appendFormatXML DOM002
Illegal character
org.w3c.dom.DOMException: DOM002 Illegal character
        at
org.apache.xerces.dom.DocumentImpl.createElement(DocumentImpl.java:482)
        at
org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:804)
        at
org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:953)
        at
org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:953)

Re: Thread safety

Posted by Andy Clark <an...@apache.org>.
Siddangouda Sankanagouda wrote:
> Anybody knows 'importNode' of DocumentImpl is thread safe. When mutiple
> threads calls importNode of DocumentImpl and trying to import the same Node
> I am getting this error. But with only one thread running,it works fine.
> Please help me..

One more time: THE DOM IMPLEMENTATION IS ___NOT___ THREAD SAFE.
You must supply your own synchronization around the operations
that you want to be thread safe. It is not worth the performance
penalty of synchronizing the entire DOM implementation, so you
are required to do that work when you access the tree from
multiple threads.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

RE: Thread safety

Posted by Jay Cain <ja...@cett.msstate.edu>.
I cannot reproduce the error you're getting. Perhaps you could send some
code that will illustrate the problem.

- - - - -
Jay Cain
Center for Educational and Training Technology
Mississippi State University

> -----Original Message-----
> From: Siddangouda Sankanagouda [mailto:gouda@calific.com]
> Sent: Wednesday, January 31, 2001 12:09 PM
> To: 'xerces-j-dev@xml.apache.org'
> Subject: Thread safety
>
>
> Hi,
>
> Anybody knows 'importNode' of DocumentImpl is thread safe. When mutiple
> threads calls importNode of DocumentImpl and trying to import the
> same Node
> I am getting this error. But with only one thread running,it works fine.
> Please help me..
>
>
> org.w3c.dom.DOMException: DOM002 Illegal character in
> appendFormatXML DOM002
> Illegal character
> org.w3c.dom.DOMException: DOM002 Illegal character
>         at
> org.apache.xerces.dom.DocumentImpl.createElement(DocumentImpl.java:482)
>         at
> org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:804)
>         at
> org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:953)
>         at
> org.apache.xerces.dom.DocumentImpl.importNode(DocumentImpl.java:953)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org