Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
1.10
-
None
-
Windows, Eclipse, apache commons 1.10
-
Patch, Important
Description
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:
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");
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.