The Application Properties screen show incorrect "DB" property value

Hi,

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.

Related Post: 应用程序属性值的显示与数据库不一致 - #3,来自 Ray.Lv - CUBA - jmix.cn
Environment:
Platform:7.2.6
DB:MYSQL

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.

Hi @AlexBudarov,

I’ve checked the problem by myself , and i can reproduce the problem not in cluster environment.
Steps:

  1. Open Application Properties screen .
  2. In a button handler of other screen controller , call the API for set db property: ConfigStorageService.setDbProperty("fts.loadSize",500).
  3. Switch back to Application Properties screen ,click “Refresh” button, the value of fts.loadSize property not changed.

Hi,

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.

BR

Hi @Maistrenko,

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.

Thank you for reporting the problem. We have created an issue, see the link on the right.

BR

1 Like