commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chethan Shankar_apache (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONFIGURATION-602) DatabaseConfiguration doesn't reload from database.
Date Tue, 26 May 2015 15:42:17 GMT
Chethan Shankar_apache created CONFIGURATION-602:
----------------------------------------------------

             Summary: DatabaseConfiguration doesn't reload from database.
                 Key: CONFIGURATION-602
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-602
             Project: Commons Configuration
          Issue Type: Bug
          Components: Build
    Affects Versions: 1.10
         Environment: Windows, Eclipse, apache commons 1.10
            Reporter: Chethan Shankar_apache
            Priority: Critical


Hi,

I have successfully setup Apache configuration to read from a database table by using DatabaseConfigurationProvider.
However when I change the database property in the DB table and read the property again, it
always has the previous value and not the updated value from Table.

My code is:
{quote}
*Setup:*
			DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(propFileUrl);
			DefaultConfigurationBuilder.ConfigurationProvider provider = new DatabaseConfigurationProvider();
			builder.addConfigurationProvider("database", provider);			
                        combinedConfig = builder.getConfiguration(true);

*Config.xml:*

                         <configuration>
                         <database jndi="jdbc/semsDs" table="CSW_APPL_PROPERTIES" keyColumn="PROP_NAME"
valueColumn="PROP_VALUE"/>
                         </configuration>

*To access table property:*
String dbProp = combinedConfig.getString("TEST_PROP");

{quote}

*Steps to recreate:*

1) Setup Apache database configuration as above.
2) Access the property from DB table TEST_PROP=TEMP_1
3) Now change the TEST_PROP to TEMP_2 in the DB table.
4) Access the new property from  the same DB Table.
5) Property Value still says TEMP_1.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message