开发者

How to refresh NHibernate cached data on WPF?

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 开发者_如何学Pythondisplayed 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?


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜