Hello Rick,
Instances of javax.xml.parsers.DocumentBuilderFactory [1] are not guaranteed to be thread-safe, so accessing an instance of this class across multiple threads should be synchronized by your application. The javadoc for DocumentBuilderFactory states that: "an application can use the same instance of the factory to obtain one or more instances of the DocumentBuilder provided the instance of the factory isn't being used in more than one thread at a time". Unless you're doing something strange like modifying the configuration of the factory while a DocumentBuilder is being instantiated on another thread, I don't think you'd run into problems with the current implementation in Xerces, but you can't count on that since DocumentBuilderFactory makes no guarantees.
[1] http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilderFactory.html
"Rick Bullotta" <[EMAIL PROTECTED]> wrote on 08/25/2004 04:36:04 PM:
> It is acceptable/safe to create a single static DocumentBuilderFactory
> instance and use it from many threads to create DocumentBuilder instances?
>
> Thanks!
>
> Rick Bullotta
> CTO
> Lighthammer Software (http://www.lighthammer.com)
>
>
> -----Original Message-----
> From: Pallavi Patil [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 25, 2004 2:06 PM
> To: [EMAIL PROTECTED]
> Subject: ref attribute
>
> Hi,
> I want to check if element has ref attribute set or
> not, can anyone help me how can I check it?
> Thanks.
>
>
>
>
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush
>
> ---------------------------------------------------------------------
> 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]
>
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
- ref attribute Pallavi Patil
- Safe to use singleton DocumentBuilderFactory? Rick Bullotta
- Re: Safe to use singleton DocumentBuilderFac... Michael Glavassevich