commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36652] - [configuration] hot-reload may corrupt configuration
Date Wed, 14 Sep 2005 10:02:16 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36652>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36652





------- Additional Comments From ebourg@apache.org  2005-09-14 12:02 -------
This issue has been on the todo list for quite some time. It could be quickly
fixed by changing the reload() method in AbstractFileConfiguration, it may look
like this :

    public void reload()
    {
        synchronized (reloadLock)
        {
            if (noReload == 0 && strategy.reloadingRequired())
            {
                // save the properties
                Map previousProperties = new LinkedMap(store);

                try
                {
                    clear();
                    load();

                    // notify the strategy
                    strategy.reloadingPerformed();
                }
                catch (Exception e)
                {
                    e.printStackTrace();

                    // rollback the changes
                    store = previousProperties;
                }
            }
        }
    }

I'm not sure it's the best way to rollback the changes though, copying the
properties seems expensive. Any idea ? Should we add a safeReload flag to
enable/disable this feature ?


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message