Hi Prashant,
That won't work either. The NodeList caches are managed by a pooling
mechanism (on the Document node) which is also not thread-safe. You need a
lock on the entire DOM instance.
Thanks.
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [E
__
>
>
> *Prashant Reddy <[EMAIL PROTECTED]>*
>
> 07/27/2007 10:50 AM Please respond to
> [EMAIL PROTECTED]
>
> To
> j-users@xerces.apache.org cc
> Soumya Chatterjee <[EMAIL PROTECTED]> Subject
> Re: Got the Issue
>
>
>
>
>
>
The DOM is not promised to be threadsafe.
The Xerces DOMs are not designed to be threadsafe; they are designed to be
reasonably fast and compact.
The fact that Node read access happens to be safe in one of our DOM
implementations does not require that Nodelist also be made safe -- and in
fact it
hant Reddy <[EMAIL PROTECTED]>
07/27/2007 10:50 AM
Please respond to
[EMAIL PROTECTED]
To
j-users@xerces.apache.org
cc
Soumya Chatterjee <[EMAIL PROTECTED]>
Subject
Re: Got the Issue
1. XML Spec does not mandate implementations of DOM to be thread safe.
2. Xerces implementation is
perience certainty.IT Services
>Business Solutions
>Outsourcing
>
>
>
> Prashant Reddy
> <[EMAIL PROTECTED]>
>
> 07/27/2007 10:50 AM
> Please respond t
usiness Solutions
> Outsourcing
>
>
>
> Michael Glavassevich
> <[EMAIL PROTECTED]>
>
> 07/26/2007 09:51 AST
>
>
>
>To
>
> j-users@xerces.apache.org
>
>
09:51 AST
To
j-users@xerces.apache.org
cc
Soumya Chatterjee <[EMAIL PROTECTED]>
bcc
Subject
Re: Got the Issue
Prashant Reddy <[EMAIL PROTECTED]> wrote on 07/26/2007 02:19:05 AM:> Like someone else suggested earlier have you tried turning off the> Defered node
Prashant Reddy <[EMAIL PROTECTED]> wrote on 07/26/2007 02:19:05 AM:
> Like someone else suggested earlier have you tried turning off the
> Defered node expansion to see if you still face any problems ?
>
>
> Try :
> docBuilderFactory.setAttribute("http://apache.
> org/xml/features/dom/defer-node
When proposing changes to Nodelist, make sure you've considered its "live
view" semantics, where changes to the model are immediately visible in the
list. That behavior seriously complicates implementing this interface, and
it's required for a correct DOM implementation. The Xerces DOM has
experim
Prashant Reddy <[EMAIL PROTECTED]>
07/26/2007 11:49 AM
Please respond to
[EMAIL PROTECTED]
To
Soumya Chatterjee <[EMAIL PROTECTED]>, j-users@xerces.apache.org
cc
Subject
Re: Got the Issue
Like someone else suggested earlier have you tried turning off the
Defered node expansi
TECTED]>
>
> 07/25/2007 06:20 PM
> Please respond to
> [EMAIL PROTECTED]
>
>
>
>
>To
> j-users@xerces.apache.org
>cc
> Soumya Chatterjee
> <[EMAIL PROTECTED]>
> Subject
> Re:
__
>
>
> Michael Glavassevich
> <[EMAIL PROTECTED]>
>
> 07/24/2007 07:27 PM
>
>
>To
> Soumya Chatterjee
> <[EMAIL PROTECTED]>
>cc
> j-users@xerces.apache.org
> Sub
http://www.w3.org/DOM/faq.html#SAXandDOM
__
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
-- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev
PROTECTED]>
>
> 07/24/2007 07:27 PM
>
>
>To
> Soumya Chatterjee
> <[EMAIL PROTECTED]>
>cc
> j-users@xerces.apache.org
> Subject
> Re: Got the Issue
>
>
>
>
>
>
>
>
&g
ED]>
cc
j-users@xerces.apache.org
Subject
Re: Got the Issue
Hi Soumya,
Xerces' DOM implementation isn't thread-safe. If you try to access the
same DOM instance from multiple threads without synchronizing it you'll
run into these problems. You either need to synchronize your
Outsourcing
Michael Glavassevich <[EMAIL PROTECTED]>
07/25/2007 02:00 AM
To
j-users@xerces.apache.org
cc
Soumya Chatterjee <[EMAIL PROTECTED]>
Subject
Re: Got the Issue
Every Node in the Xerces DOM is also its child NodeLis
Every Node in the Xerces DOM is also its child NodeList (i.e. node ==
node.getChildNodes()). You get the same object every time. If a single
thread is doing something like:
...
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; ++i) {
for (int j =
SolutionsOutsourcing
Michael Glavassevich <[EMAIL PROTECTED]>
07/24/2007 15:29 AST
To
j-users@xerces.apache.org
cc
Soumya Chatterjee <[EMAIL PROTECTED]>
bcc
Subject
Re: Got the Issue
The non-deferred DOM (yes it's still supported; it's the default impl
Right. I wouldn't expect nodelists to be threadsafe, but do we reuse
nodelists, or would independent calls to retrieve the same nodelist return
separate (non-entangled) objects?
I would expect the latter, since there could be several nodelist accesses
in progress at once even for a single thread.
The non-deferred DOM (yes it's still supported; it's the default impl for
an LSParser) isn't thread-safe for reads either. For instance, it caches
the last position accessed in a NodeList (returned from
Node.getChildNodes()) as well as its length. This is done for performance
reasons. Without i
Per the W3C spec, the DOM API does not promise to support multithread
access. Doing so would impose performance/implementation limitations on all
applications, even single-threaded ones, which was considered undesirable.
Also, in most cases what you really need is threadsafety at a much higher
lev
esBusiness SolutionsOutsourcing
Prashant Reddy <[EMAIL PROTECTED]>
07/24/2007 19:59
Please respond to [EMAIL PROTECTED]
To
j-users@xerces.apache.org
cc
Soumya Chatterjee <[EMAIL PROTECTED]>
bcc
Subject
Re: Got the Issue
On Tue, 2007-07-24 at 09:57 -0400, Michael Glavassevich w
://www.tcs.comExperience certainty. IT ServicesBusiness SolutionsOutsourcing
Michael Glavassevich <[EMAIL PROTECTED]>
07/24/2007 09:57 AST
To
Soumya Chatterjee <[EMAIL PROTECTED]>
cc
j-users@xerces.apache.org
bcc
Subject
On Tue, 2007-07-24 at 09:57 -0400, Michael Glavassevich wrote:
> Synchronization is not an option in this case because there is a
> > huge performance issue here. Please let me know if any way we can
> > get read of this problem without using the Synchronization block.
> >
Is your use-case,
Hi Soumya,
Xerces' DOM implementation isn't thread-safe. If you try to access the
same DOM instance from multiple threads without synchronizing it you'll
run into these problems. You either need to synchronize your code or
create an instance of the DOM tree per thread. There's really no way
ar
25 matches
Mail list logo