Apply flag to setUseCreatedTime method which has a DB call for the table check
@@ -80,11 +80,9 @@ public class ConfigurationManagerComponent {
bundleContext.registerService(ConfigurationManager.class.getName(),
new ConfigurationManagerImpl(configurationManagerConfigurationHolder), null);
-
- setUseCreatedTime();
-
ConfigurationManagerComponentDataHolder.getInstance().setConfigurationManagementEnabled
(isConfigurationManagementEnabled());
+ setUseCreatedTime();
} catch (Throwable e) {
log.error("Error while activating ConfigurationManagerComponent.", e);
}
@@ -142,7 +140,8 @@ public class ConfigurationManagerComponent {
private void setUseCreatedTime() throws DataAccessException {
- if (isCreatedTimeFieldExists()) {
+ if (ConfigurationManagerComponentDataHolder.getInstance().isConfigurationManagementEnabled() &&
+ isCreatedTimeFieldExists()) {
ConfigurationManagerComponentDataHolder.setUseCreatedTime(true);
} else {
ConfigurationManagerComponentDataHolder.setUseCreatedTime(false);
