You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Irina Fridkina (JIRA)" <ji...@apache.org> on 2007/04/17 02:07:15 UTC

[jira] Created: (CONFIGURATION-265) XMLConfiguration with setAutoSave(true) doesn't save if SubnodeConfiguration is changed

XMLConfiguration with setAutoSave(true) doesn't save if SubnodeConfiguration is changed
---------------------------------------------------------------------------------------

                 Key: CONFIGURATION-265
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-265
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Irina Fridkina
             Fix For: 1.5


config.xml file
<conf>
    <parent-item>
        <sub-item>old_value</sub-item>
    </parent-item>
</conf>

The problem can be reproduced as follows: 

 1 XMLConfiguration config = new XMLConfiguration("c:\\conf.xml"); 
 2 config.setAutoSave(true) ;
 3 SubnodeConfiguration parentItemConfig = config.configurationAt("parent-item"); 
 4 parentItemConfig.setProperty("sub-item","new_value");
 5. System.out.println(config.getString("parent-item.sub-item");  // will print new_value
 // if you look at the config.xml sub-item still has old_value

 // also if you try to do 
 5 XMLConfiguration config2 = new XMLConfiguration("c:\\conf.xml");
 6. System.out.println(config2.getString("parent-item.sub-item");  // will print old_value


-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (CONFIGURATION-265) XMLConfiguration with setAutoSave(true) doesn't save if SubnodeConfiguration is changed

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-265.
----------------------------------------

    Resolution: Fixed

A fix was applied for triggering the auto-save mechanism for changes at a subnode configuration. There is now also the new event type EVENT_SUBNODE_CHANGED that is fired in such a case.

> XMLConfiguration with setAutoSave(true) doesn't save if SubnodeConfiguration is changed
> ---------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-265
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-265
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Irina Fridkina
>         Assigned To: Oliver Heger
>             Fix For: 1.5
>
>
> config.xml file
> <conf>
>     <parent-item>
>         <sub-item>old_value</sub-item>
>     </parent-item>
> </conf>
> The problem can be reproduced as follows: 
>  1 XMLConfiguration config = new XMLConfiguration("c:\\conf.xml"); 
>  2 config.setAutoSave(true) ;
>  3 SubnodeConfiguration parentItemConfig = config.configurationAt("parent-item"); 
>  4 parentItemConfig.setProperty("sub-item","new_value");
>  5. System.out.println(config.getString("parent-item.sub-item");  // will print new_value
>  // if you look at the config.xml sub-item still has old_value
>  // also if you try to do 
>  5 XMLConfiguration config2 = new XMLConfiguration("c:\\conf.xml");
>  6. System.out.println(config2.getString("parent-item.sub-item");  // will print old_value

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-265) XMLConfiguration with setAutoSave(true) doesn't save if SubnodeConfiguration is changed

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490649 ] 

Oliver Heger commented on CONFIGURATION-265:
--------------------------------------------

This is indeed a bug, updates in the subnode configuration do not trigger the parent's auto-save mechanism.

To be consequent, these updates should then also generate change events for the parent configuration. However this will be problematic because we cannot simply transform the configuration key used by the subnode configuration into the namespace of the parent (the expression engines do not provide this functionality at the moment).  So the only chance I see is to introduce a new event type EVENT_SUBNODE_CHANGED. The properties of this event type can contain all available information about the change.

In the next major release we can extend the interface for the expression engines to work around this limitation.

> XMLConfiguration with setAutoSave(true) doesn't save if SubnodeConfiguration is changed
> ---------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-265
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-265
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Irina Fridkina
>             Fix For: 1.5
>
>
> config.xml file
> <conf>
>     <parent-item>
>         <sub-item>old_value</sub-item>
>     </parent-item>
> </conf>
> The problem can be reproduced as follows: 
>  1 XMLConfiguration config = new XMLConfiguration("c:\\conf.xml"); 
>  2 config.setAutoSave(true) ;
>  3 SubnodeConfiguration parentItemConfig = config.configurationAt("parent-item"); 
>  4 parentItemConfig.setProperty("sub-item","new_value");
>  5. System.out.println(config.getString("parent-item.sub-item");  // will print new_value
>  // if you look at the config.xml sub-item still has old_value
>  // also if you try to do 
>  5 XMLConfiguration config2 = new XMLConfiguration("c:\\conf.xml");
>  6. System.out.println(config2.getString("parent-item.sub-item");  // will print old_value

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org