commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: synchronization and XMLPropertiesConfiguration
Date Wed, 18 Apr 2012 19:40:31 GMT
Hi Julien,

Am 18.04.2012 09:10, schrieb Julien Wajsberg:
> Hi,
> I've a question about XMLPropertiesConfiguration in commons-configuration.
> It's said in the Java Doc that "Configuration objects of this type can
> be read concurrently by multiple threads. However if one of these
> threads modifies the object, synchronization has to be performed
> manually." I'd like to know more, especially about what should be
> synchronized.
> 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.

> Also, if manual synchronizing is needed (because we change one of
> these values), should it be done on the reloadLock returned by
> getReloadLock, and then we'd not have to synchronize manually on
> loading/saving/setting ?

Yes, the reloadLock is a good option because it is already used by some 
internal methods of the library.


> Thanks,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message