commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-330) Thread safety for file based configurations
Date Tue, 03 Jun 2008 20:22:45 GMT


Oliver Heger commented on CONFIGURATION-330:

I would prefer an approach as used by the Java collections framework: keep the basic configuration
implementations free of any synchronization stuff, but provide a means for obtaining a synchronized
instance. This way a user can choose whether synchronization is needed or not.

Using ReadWriteLock would complicate the code and would not be necessary for many use cases.

Maybe proxies could be used for implementing this feature. (Proxies could also be useful for
other features, e.g. read-only configurations.)

> Thread safety for file based configurations
> -------------------------------------------
>                 Key: CONFIGURATION-330
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: Emmanuel Bourg
>             Fix For: 2.0
> When autoSave is enabled on a FileConfiguration it's quite frequent to run into a ConcurrentModificationException,
simply because setProperty is called from a thread while another thread is saving the configuration.
> I suggest to leverage the ReadWriteLock in Java 5 to solve this issue. The read lock
is acquired in getProperty(), and the write lock is acquired in setProperty().

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

View raw message