如何刷新 WPF 上的 NHibernate 缓存数据?

发布于 2024-08-16 22:40:15 字数 235 浏览 0 评论 0原文

我有一个使用 NHibernate 和延迟数据加载的 WPF 应用程序。我还使用 Microsoft Sync 框架与中央数据库服务器同步数据。因此,当我修改中央数据库服务器上的数据并将其与 WPF 客户端应用程序同步时,我无法将最新数据显示到 UI,因为 NHibernate 已经缓存了它。所以我需要重新启动WPF应用程序才能显示最新的同步数据。

我需要一个解决方案来刷新 WPF 应用程序上的 NHibernate 数据。我该怎么做?

I have this WPF application using NHibernate and lazy data loading. I also use Microsoft Sync framework to sync data to and from a central database server. So what happens is that when I modify data on the central database server and sync it with the WPF client app, I can't get the latest data to be displayed to the UI since NHibernate has cached it already. So I need to restart the WPF application to be able to display the latest synched data.

I need a solution to refresh NHibernate data on the WPF app. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

梦忆晨望 2024-08-23 22:40:15

一级缓存仅在给定会话中处于活动状态,因此,如果您每次尝试检索对象时都使用新会话,您应该会获得最新结果(假设您没有配置二级缓存)。

The first level cache is only active within a given session, so if you use a new session each time you attempt to retrieve the object you should get the latest results (given you don't have the second level cache configured).

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