commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: synchronization and XMLPropertiesConfiguration
Date Thu, 19 Apr 2012 05:52:10 GMT
Am 18.04.2012 23:35, schrieb Julien Wajsberg:
> Hi Olivier,
>
> On 18 April 2012 21:40, Oliver Heger<oliver.heger@oliver-heger.de>  wrote:
>>>
>>> As I understand it, modifying the object means changing one of its
>>> core values, like the file to load from/save to, the encoding, etc. It
>>> doesn't mean adding or setting a property. Is that true ?
>>
>>
>> No, the configuration's properties are also affected. Internally, they are
>> stored in node-like structures which are not synchronized against concurrent
>> access. Therefore concurrent modifications can have unexpected results.
>
> However, it seems like setProperty is synchronized with the reloadLock as well ?
> (see http://grepcode.com/file/repo1.maven.org/maven2/commons-configuration/commons-configuration/1.8/org/apache/commons/configuration/AbstractFileConfiguration.java#AbstractFileConfiguration.setProperty%28java.lang.String%2Cjava.lang.Object%29)
>
> Am I missing something ?
You are right.

Originally access to properties was not thread-safe. Later on changes 
have been made to support concurrent access, so my information is not 
up-to-date.

However, I was not the author, and I am not sure whether really all 
access paths are synchronized.

Oliver

>
> Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message