You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2015/05/28 21:34:18 UTC
[jira] [Closed] (CONFIGURATION-602) DatabaseConfiguration doesn't
reload from database.
[ https://issues.apache.org/jira/browse/CONFIGURATION-602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oliver Heger closed CONFIGURATION-602.
--------------------------------------
> 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
> Labels: DatabaseConfigurationProvider, commons-configuration, configuration
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> 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);
> ReloadingStrategy strategy = new FileChangedReloadingStrategy();
> ((FileChangedReloadingStrategy) strategy).setRefreshDelay(5000);
> builder.setReloadingStrategy(strategy);
> 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 value to TEMP_2 in the DB table.
> 4) Access the property from the same DB Table.
> 5) Property Value still says TEMP_1.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)