Apache Team,

Major concern for us with DOM parser in multi thread environment. Can you
please review this and provide your inputs? Thanks.

OS: Sun Solaris 10
Server: Websphere 6
JDK: 1.4
Xerces version: Xerces_Version_1_2_0
Number of Daemon threads per JVM: 3

Scenario:

In our Production environment when 3 daemon threads run under a JVM.

When 3 similar type of XML messages gets parsed at same second
(concurrently) under a JVM, we notice some attribute gets missed. We went
through net and found that DOM implementation is not guaranteed to be
thread safe. But question is why it is not thread safe? Which part can go
wrong? Please provide details.


Below is the piece of code:

public Document parse(InputSource inputSource, boolean isValidating) throws
SAXException,IOException {

            if ( getEntityResolver() == null )
                  throw new IllegalStateException("EnitityResolver is not
set");

            DocumentBuilder docBuilder = getDocumentBuilder(isValidating);

                  // parsing from input source
            docBuilder.setEntityResolver(getEntityResolver());
            docBuilder.setErrorHandler    (getErrorHandler());

            return docBuilder.parse(inputSource);

      }

Sample xml passed to this code is attached: sample_message.xml

(See attached file: sample_message.xml)



Thanks,
karthik



This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only.  If by an addressing or transmission error 
this mail has been misdirected to you, you are requested to delete this mail 
immediately. You are also hereby notified that any use, any form of 
reproduction, dissemination, copying, disclosure, modification, distribution 
and/or publication of this e-mail message, contents or its attachment other 
than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polarisFT.com

Attachment: sample_message.xml
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to