You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Andy <an...@hotmail.com> on 2010/12/06 17:57:42 UTC

Thread safety question

Hi,
I posted this question on the user mailing list but I'm not sure if the answer I got was accurate so I thought to ask the developer list.

Is XmlObject.Factory.parse() thread-safe?  I have many concurrent threads calling this method and want to make sure each thread is getting back what it is supposed to.

Thanks- 		 	   		  

RE: Thread safety question

Posted by Andy <an...@hotmail.com>.
> Note also that the parse method is static so it would be pretty brutal> if it weren't thread safe. :-)I agree.  But I didn't know for sure.
The way I am planning to use it is pretty vanilla.  I will be receiving independent xml documents back from a web service and unmarshaling each of them into unique XmlObject instances.
Thanks for responding.  If anyone else has any feedback as well, please let me know.
Andy

> Date: Mon, 6 Dec 2010 15:10:13 -0500
> From: rocketraman@fastmail.fm
> To: andrhahn@hotmail.com
> CC: dev@xmlbeans.apache.org
> Subject: Re: Thread safety question
> 
> On 12/06/2010 11:57 AM, Andy wrote:
> > Hi,
> > I posted this question on the user mailing list but I'm not sure if
> > the answer I got was accurate so I thought to ask the developer list.
> > 
> > Is *XmlObject.Factory.parse() *thread-safe?  I have many concurrent
> > threads calling this method and want to make sure each thread is
> > getting back what it is supposed to.
> 
> I'm not an XmlBeans developer but... I've never had a problem with
> concurrent threads calling the parse method. Now obviously if the
> input value is mutable e.g. a node, then presumably that input object
> shouldn't be modified by another thread.
> 
> Note also that the parse method is static so it would be pretty brutal
> if it weren't thread safe. :-)
> 
> Cheers,
> Raman
 		 	   		  

Re: Thread safety question

Posted by Raman Gupta <ro...@fastmail.fm>.
On 12/06/2010 11:57 AM, Andy wrote:
> Hi,
> I posted this question on the user mailing list but I'm not sure if
> the answer I got was accurate so I thought to ask the developer list.
> 
> Is *XmlObject.Factory.parse() *thread-safe?  I have many concurrent
> threads calling this method and want to make sure each thread is
> getting back what it is supposed to.

I'm not an XmlBeans developer but... I've never had a problem with
concurrent threads calling the parse method. Now obviously if the
input value is mutable e.g. a node, then presumably that input object
shouldn't be modified by another thread.

Note also that the parse method is static so it would be pretty brutal
if it weren't thread safe. :-)

Cheers,
Raman

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


RE: Thread safety question

Posted by Andy <an...@hotmail.com>.
Cezar,

Thank you very much.  I can rest assured now :)

Andy

Date: Wed, 8 Dec 2010 09:47:39 -0800
From: cezar.andrei@oracle.com
To: dev@xmlbeans.apache.org
Subject: RE: Thread safety question



















Andy,

 

The method is thread-safe, as should be all
public API XmlObject methods.

There is one special case: the usage of a
non documented option that would make it not thread safe, which is most probably
not your case.

 

Hope this answers your question.

Cezar

 









From: Andy
[mailto:andrhahn@hotmail.com] 

Sent: Monday, December 06, 2010
10:58 AM

To: dev@xmlbeans.apache.org

Subject: Thread safety question



 

Hi,

I posted this question on the user mailing list but I'm not sure if the answer
I got was accurate so I thought to ask the developer list.



Is XmlObject.Factory.parse() thread-safe? 
I have many concurrent threads calling this method and want to make sure each
thread is getting back what it is supposed to.



Thanks- 

 		 	   		  

RE: Thread safety question

Posted by Cezar Andrei <ce...@oracle.com>.
Andy,

 

The method is thread-safe, as should be all public API XmlObject methods.

There is one special case: the usage of a non documented option that would make it not thread safe, which is most probably not your case.

 

Hope this answers your question.

Cezar

 

  _____  

From: Andy [mailto:andrhahn@hotmail.com] 
Sent: Monday, December 06, 2010 10:58 AM
To: dev@xmlbeans.apache.org
Subject: Thread safety question

 

Hi,
I posted this question on the user mailing list but I'm not sure if the answer I got was accurate so I thought to ask the developer list.

Is XmlObject.Factory.parse() thread-safe?  I have many concurrent threads calling this method and want to make sure each thread is getting back what it is supposed to.

Thanks-