开发者

Spring beans with database properties which are also reload-able

开发者 https://www.devze.com 2023-02-22 06:41 出处:网络
My question is basically is a followup question to this one, I need Spring to inject properties to bean which are loaded from DB (this is answered in the above question) another like to be able to rel

My question is basically is a followup question to this one, I need Spring to inject properties to bean which are loaded from DB (this is answered in the above question) another like to be able to reload these properties. So when I change property value in the DB:

How can this be done?

Thanks


Spring does not contain any built-in logic which would continuously watch your database and invoke some method when data changes (which is what you have described).

You would need to implement some logic yourself to continually poll the database, detect changes, and then re-populate the beans.

0

精彩评论

暂无评论...
验证码 换一张
取 消