apache DatabaseConfiguration 中的动态重新加载
有人为 apache commons 数据库配置对象开发了动态重载机制吗?
Has anyone developed a dynamic reload mechanism for the apache commons database configuration object?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上这是不必要的,因为 DatabaseConfiguration 不会缓存数据库中的值。每次获取属性时都会执行一次请求。有一个 RFE 可以缓存这些值以提高性能,这确实需要重新加载机制。
https://issues.apache.org/jira/browse/CONFIGURATION-180
Actually this is not necessary because DatabaseConfiguration doesn't cache the values from the database. A request is performed every time a property is fetched. There is a RFE to cache the values for improved performance, and this will indeed require a reloading mechanism.
https://issues.apache.org/jira/browse/CONFIGURATION-180
apache commons 数据库配置不支持缓存。
我扩展了 DatabaseConfiguration 以支持缓存,这样它就不会一直访问我的数据库。
至于重新加载,我在需要的地方实例化我的配置,并在完成后将其丢弃。
apache commons database configuration does not support caching.
I extend DatabaseConfiguration to support caching so it does not hit my database all the time.
As for reloads, I instantiate my config where I need it and throw it away when I am done with it.