You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Emilio Belmonte <Em...@ENTRUST.COM> on 2002/05/16 21:09:49 UTC

is SOAP thread-safe?

I noticed that this method:

XmlParserUtils.getXMLDocBuilder()

is not synchronized.  According to the JAXP documentation, the
DocumentBuilderFactory class is not thread-safe.  Is there any reason for
not synchronizing it?

Thank you,

--Emilio

RE: [PATCH] Re: is SOAP thread-safe?

Posted by "Matthew J. Duftler" <du...@watson.ibm.com>.
Hi Scott & Emilio,

I agree that getXMLDocBuilder should be synchronized. I've committed your
change.

Thanks,
-Matt

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Friday, May 17, 2002 1:03 PM
> To: soap-dev@xml.apache.org
> Subject: [PATCH] Re: is SOAP thread-safe?
>
>
> I don't know about whether DocumentBuilderFactory is not thread-safe, but
> refreshDocumentBuilderFactory and getXMLDocBuilder need to be
> synchronized with
> respect to one another, as the former assigns to the dbf member then calls
> methods on it to set parsing attributes.  The assignment and
> attribute setting
> should be atomic, right?
>
> I've attached the trivial patch that changes getXMLDocBuilder to be
> synchronized.
>
> Scott
>
> ----- Original Message -----
> From: "Emilio Belmonte" <Em...@ENTRUST.COM>
> To: <so...@xml.apache.org>
> Sent: Thursday, May 16, 2002 3:09 PM
> Subject: is SOAP thread-safe?
>
>
> > I noticed that this method:
> >
> > XmlParserUtils.getXMLDocBuilder()
> >
> > is not synchronized.  According to the JAXP documentation, the
> > DocumentBuilderFactory class is not thread-safe.  Is there any
> reason for
> > not synchronizing it?
> >
> > Thank you,
> >
> > --Emilio
> >
>


RE: [PATCH] Re: is SOAP thread-safe?

Posted by "Matthew J. Duftler" <du...@watson.ibm.com>.
Hi Scott & Emilio,

I agree that getXMLDocBuilder should be synchronized. I've committed your
change.

Thanks,
-Matt

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Friday, May 17, 2002 1:03 PM
> To: soap-dev@xml.apache.org
> Subject: [PATCH] Re: is SOAP thread-safe?
>
>
> I don't know about whether DocumentBuilderFactory is not thread-safe, but
> refreshDocumentBuilderFactory and getXMLDocBuilder need to be
> synchronized with
> respect to one another, as the former assigns to the dbf member then calls
> methods on it to set parsing attributes.  The assignment and
> attribute setting
> should be atomic, right?
>
> I've attached the trivial patch that changes getXMLDocBuilder to be
> synchronized.
>
> Scott
>
> ----- Original Message -----
> From: "Emilio Belmonte" <Em...@ENTRUST.COM>
> To: <so...@xml.apache.org>
> Sent: Thursday, May 16, 2002 3:09 PM
> Subject: is SOAP thread-safe?
>
>
> > I noticed that this method:
> >
> > XmlParserUtils.getXMLDocBuilder()
> >
> > is not synchronized.  According to the JAXP documentation, the
> > DocumentBuilderFactory class is not thread-safe.  Is there any
> reason for
> > not synchronizing it?
> >
> > Thank you,
> >
> > --Emilio
> >
>


[PATCH] Re: is SOAP thread-safe?

Posted by Scott Nichol <sn...@scottnichol.com>.
I don't know about whether DocumentBuilderFactory is not thread-safe, but
refreshDocumentBuilderFactory and getXMLDocBuilder need to be synchronized with
respect to one another, as the former assigns to the dbf member then calls
methods on it to set parsing attributes.  The assignment and attribute setting
should be atomic, right?

I've attached the trivial patch that changes getXMLDocBuilder to be
synchronized.

Scott

----- Original Message -----
From: "Emilio Belmonte" <Em...@ENTRUST.COM>
To: <so...@xml.apache.org>
Sent: Thursday, May 16, 2002 3:09 PM
Subject: is SOAP thread-safe?


> I noticed that this method:
>
> XmlParserUtils.getXMLDocBuilder()
>
> is not synchronized.  According to the JAXP documentation, the
> DocumentBuilderFactory class is not thread-safe.  Is there any reason for
> not synchronizing it?
>
> Thank you,
>
> --Emilio
>

[PATCH] Re: is SOAP thread-safe?

Posted by Scott Nichol <sn...@scottnichol.com>.
I don't know about whether DocumentBuilderFactory is not thread-safe, but
refreshDocumentBuilderFactory and getXMLDocBuilder need to be synchronized with
respect to one another, as the former assigns to the dbf member then calls
methods on it to set parsing attributes.  The assignment and attribute setting
should be atomic, right?

I've attached the trivial patch that changes getXMLDocBuilder to be
synchronized.

Scott

----- Original Message -----
From: "Emilio Belmonte" <Em...@ENTRUST.COM>
To: <so...@xml.apache.org>
Sent: Thursday, May 16, 2002 3:09 PM
Subject: is SOAP thread-safe?


> I noticed that this method:
>
> XmlParserUtils.getXMLDocBuilder()
>
> is not synchronized.  According to the JAXP documentation, the
> DocumentBuilderFactory class is not thread-safe.  Is there any reason for
> not synchronizing it?
>
> Thank you,
>
> --Emilio
>