commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-278) ConcurrentModificationException in PropertiesConfigurationLayout
Date Fri, 01 Jun 2007 11:52:15 GMT


Oliver Heger commented on CONFIGURATION-278:

Most of our configuration classes are not thread-safe when they are updated (concurrent read-only
access should be unproblematic though). For instance BaseConfiguration uses a plain Map for
storing its data.

I disagree that unpredictable results in case of concurrent modifications are better than
an exception. This would make bugs of this kind nearly undetectable. The tread-safety (or
unsafety) of the configuration classes should be clearly documented (I am not sure whether
there is already some information about this on our site), then it is up to the user to handle
this properly.

A decorator for synchronizing configurations is something I also had in mind. This is analogous
to the way the Java collections framework handles this topic: plain collections are unsynchronized,
but if needed, synchronization can easily be added. I am not sure how such a decorator could
be implemented in an elegant way; maybe AOP or dynamic proxies could be a good choice.

So I would suggest closing this ticket as WON'T FIX and opening a new one for the decorator.

> ConcurrentModificationException in PropertiesConfigurationLayout
> ----------------------------------------------------------------
>                 Key: CONFIGURATION-278
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Emmanuel Bourg
>             Fix For: 1.5
> PropertiesConfigurationLayout is not thread safe, if a configuration event is received
when the configuration is being saved, a ConcurrentModificationException is thrown :
> java.util.ConcurrentModificationException
>     at$LinkIterator.nextEntry(
>     at$
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at org.apache.commons.configuration.AbstractFileConfiguration.possiblySave(
>     at org.apache.commons.configuration.AbstractFileConfiguration.clearProperty(
>     at org.apache.commons.configuration.DataConfiguration.clearProperty(
>     at org.apache.commons.configuration.AbstractConfiguration.setProperty(
> This happens easily in a multi threaded application using a central configuration with
auto saved enabled.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message