Seems the Application Properties screen can’t show the current value of db property when the value is changed through API: ConfigStorageService.setDbProperty(String name, @Nullable String value);) . Seems the screen always read a cached property value, when the value get updated is uncertain,But ConfigStorageService.getDbProperty can get correct value.
Hi,
If you look deeply into the implementation of the ConfigStorageService#setDbProperty, you will see that after updating value in the database it clears local configuration cache and sends cluster message to other cluster members to do the same.
Values displayed in the Application Properties screen are taken from the same cache in the core module, see com.haulmont.cuba.core.config.AppPropertiesLocator#findDatabaseStoredProperties.
My guess is that user on the forum has cluster environment with 2 or more nodes, but he/she has not configured JGroups cluster. And because of this nodes can’t communicate with each other and clear configuration settings cache when necessary.
Unfortunately, we cannot reproduce the problem. We will be able to help you if you send us a small sample project along with reproduction scenario that demonstrates the issue.
I created a empty project and checked again, can reproduce the problem. dbproperty.zip (71.7 KB)
Run the project, click the Application\User.browsetest screen ,then click “SetDBProperty” button, watch the console,you can see some logs like following:
22:43:35.861 INFO c.h.cuba.core.app.ConfigStorage - Loading DB-stored app properties cache
22:43:35.862 INFO c.c.d.w.screens.user.UserBrowseTest - new value :40
22:50:21.127 INFO c.c.d.w.screens.user.UserBrowseTest - current value:40
22:50:21.127 INFO c.c.d.w.screens.user.UserBrowseTest - value to set:41
22:50:21.143 INFO c.h.cuba.core.app.ConfigStorage - Loading DB-stored app properties cache
22:50:21.144 INFO c.c.d.w.screens.user.UserBrowseTest - new value :41
The value of cuba.maxUploadSizeMb property is changed through API, the behavior is right.
But open the Application Properties screen,you can see the value of cuba.maxUploadSizeMb property is not changed.