Hi,
from my testing, I no longer believe that the problem
lies with the DeferredDOM implementation. I am seeing
the same NullPointerException right in the middle of
my test, where all the leaf nodes should already have
been loaded by previous tests.

To recap (since I noticed that my original mail has
been cut off  :)   ),
I am running a load test using JUnit and JUnitPerf
that continuously and concurrently read from 3 leaf
nodes of an XML DOM tree for a few thousand times. On
some occasions, not all the time, the tests failed
with a NullPointerException (although none of the
source code was changed, I just keep running the
concurrency tests again and again until it failed).

Initially when I posted this problem in this mailing
list, I thought the problem lies with xerces' deferred
DOM impl, but I noticed now that the error occurred in
the middle of my tests and sometimes near the end,
after thousands of successful access of exactly the
same leaf nodes, so it cannot be because the values
were not loaded in time for another thread to access,
as I had previously suspected.

Upon more careful debugging I found that the
NullPointer resulted when I tried to access a node
list of 21 nodes (I used getLength to give me the
number), then when I tried this:
((Node) nodelist.item(i)).getNodeType()
it will throw NullPointer because the nodelist.item(i)
returned NULL. (where i is less than 21, I printed out
the value of i, which also varies at the point of
error). 
This kind of indeterministic behaviour in Xerces DOM
worries me....

My question is: is it possible, when one thread is
accessing a node, that the xerces DOM impl will return
null when another thread attempts to access the same
node at the same time? I thought the DOM tree should
allow concurrent access?

Cheers,
Herry

 --- Herry Koh <[EMAIL PROTECTED]> wrote: > Yes, I
think for the scenario of concurrent access,
> I should turn off 
> the deferred feature. Will try it out and let you
> know.
> 
> Thanks
> 
> Cheers,
> Herry
> 
> 
> On 9 May 2002, at 9:37, Christopher Ebert wrote:
> 
> > 
> >     Hi Herry,
> > 
> > <snip/>
> > I suspect this has something to do with the
> DeferredDOM impl, 
> > perhaps, while one thread is accessing the leaf
> node for the first 
> > time, another thread came in, thought that the
> leaf node has 
> > already been access and attempts to retrieve the
> values, resulting 
> > in NULL pointer. Is that possible? Just a guess.
> > <snip/>
> > 
> >     Have you tried traversing the entire tree before
> starting the
> > test? Or turning 'deferred' off? There's a flag
> somewhere, can't
> > remember if it's a 'feature' or a 'property'
> though. I'm curious about
> > what you find -- I'm moving more into XSLT and
> will likely run into
> > these problems in the future :).
> > 
> > 
> >     Chris
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__________________________________________________
Do You Yahoo!?
Yahoo! Kickin' Party - Win a 5-star getaway to exotic Bali!
http://kickin.yahoo.com.sg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to