定期刷新或使eclipselink中的整个缓存失效
有没有办法定期(比如每 5 分钟)使 eclipselink 中的整个缓存失效。 这可以在 persistence.xml 文件的属性中完成吗?
is there a way invalidate the entire cache in eclipselink periodically (say every 5mins).
can this be done in a property in the persistence.xml file ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在每个实体上设置缓存失效超时,
请参阅@Cache注释。
您可以使用 SessionCustomizer 迭代所有描述符并为所有描述符设置默认值。
您还可以在运行时使用 JpaCache API 来使整个缓存失效。您可以使用 EJB 计时器来调用它。
You can set a cache invalidation timeout on each entity,
See the @Cache annotation.
You could use a SessionCustomizer to iterate over all descriptors and set a default on all of them.
You could also use the JpaCache API at runtime to invalidate the entire cache. You could use an EJB timer to call this.