定期刷新或使eclipselink中的整个缓存失效

发布于 2024-12-26 04:41:15 字数 79 浏览 0 评论 0原文

有没有办法定期(比如每 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゞ记忆︶ㄣ 2025-01-02 04:41:15

您可以在每个实体上设置缓存失效超时,

请参阅@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文