Thanks Prashant for the suggestion. Is our case, we need to create the DOM once and reads multiple times in a concurrent access. I think it may be worth implementing a higher level read-only(immutable) Data tree that reads only once from the DOM.
Don't you think it is strange that read also needs to be synchronized? I had gone through the documentation and found out why it requires to be synchronized. This is mainly due to the performance / Caching mechanism. But don't you think we should have an alternative implementation where read should not give the nullpointerexception. There is all the time a tradeoff between performance and accuracy.
Thanks,
Soumya Chatterjee
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
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 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, creates the DOM once and reads multiple times in a
concurrent access ?
The thing is that DOM traversal is not thread safe when accessed
concurrently even though there are *no* writes.
If your use case is similar (no writes to XML), it may be worth
implementing a higher level read-only(immutable) Data tree that reads
only once from the DOM/SAX.
Of course you should measure the performance benefits before deploying
the solution.
--
-Prashant
Don't upload, just share : www.dekoh.com
ForwardSourceID:NT00020C36
=====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you