将数据库缓存到每 5 分钟刷新一次的数组中
我需要使用 Java 将数据库缓存到数组中,最好的方法是什么?
我需要这个数组每 5 分钟刷新一次,并且我需要能够查询该数组。
我希望使用两个数组和某种形式的 DAO DTO 实现。
有没有这方面的既定框架?
I need to cache a database into an array using Java, what is the best way to do this?
I need this array to refresh every 5 minutes and I need to be able to query the array.
I'm looking to use two arrays and Some form of DAO DTO implementation.
Are there any set frameworks for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
让您的生活更轻松的一些关键点:
Some key points to make your life easier:
您可以使用 ehcache 来实现此目的,您需要配置 DAO DTO 实现来缓存其结果和结果。从缓存中查找结果...
可以通过配置驱逐时间(缓存被清除的时间段)来实现缓存刷新。
you can use ehcache for this, you need to configure your DAO DTO implementation to cache its results & lookup results from the cache...
you can achieve the cache refresh by configuring the eviction time (time period for the cache to be cleared).