help with second level cache using NHibernate and memcached

我如何读取/写入缓存的时间周期,即10秒,然后将更改提交到数据库?


I'm not 100% sure for NHibernate but Hibernate 2nd level cache does NOT offer Write-Behind caching, Hibernate just directly writes to the database. I think the same applies to NHibernate. In other words, what you'd like to do is IMO not possible, at least not without modifying NHibernate to write to the 2nd level cache and a persistent async-database-queue. But that would be a really non trivial change and is not going to happen short term.


The changes you make will be committed to the database upon the transaction commit independent of whether they were cached or not. As such, you'd need to avoid committing the transaction for that period of time.

链接地址: http://www.djcxy.com/p/71056.html

上一篇: ASP.NET MVC3:TryUpdateModel抛出异常

下一篇: 使用NHibernate和memcached帮助二级缓存