我有两个对象 -
ContentPage
和它所拥有的一个ChildLinks
集合。ContentPage
-----------
ID
Title
ChildLink
----------
ID
ParentPageID [ContentPage]
ChildPageID [ContentPage]
Priority
ContentPage.ChildLinks
属性利用了二级缓存。我正在使用Fluent NH配置Nhibernate,同时使用Nhibernate 3.1。对于集合和“ChildLink”类,缓存都被设置为“读-写”。
我注意到每当我删除一个ChildLink
时,集合缓存没有被无效化。因此,当我调用ContentPage.ChildLinks
时,会出现错误:
no row with the given identifier exists
我已经关闭了缓存,现在很正常。难道缓存不应该自动失效吗?我使用的是 SysCache 作为缓存提供程序,MySQL 作为数据库。
非常感谢提前!