Simon Taylor - .Net developer, Cheltenham

My record of coding problems solved and new things discovered

How NHibernate integrates with second level cache

clock April 23, 2010 01:03 by author Simon

It's never been 100% clear to me when using second level cache with NHibernate, when NHibernate accesses the cache and when it needs to go to the database directly. There is a great explanation of how NHibernate uses caching in The NHibernate FAQ, but even after reading this, I still wasn't completely clear on when NHibernate has to hit the database, so I went about testing it out myself. Below are the results of my testing; I was using NHibernate 2.1.2.400, FluentNHibernate 1.0.0.629, SQLServer 2008 and NCache 3.6. I created a single test consisting of each of the code snippets below and I set the NHibernate show_sql configuration parameter to true so that I could see when NHibernate hit the database. I also created an IClassConvention that tells NHibernate to cache all entities as read write (in reality I would probably be more granular than this). More...



.Net Service Provider

clock February 22, 2009 13:00 by author Simon

I had a similar problem to solve in .Net to the one I solved in Java using the ServiceLocator class. I moved the NHibernateSessionManager to a library but needed a way of registering project specific interceptors. Here is the code:More...



About the author

Simon is currently living and working in Toronto, Canada as a software consultant for Infusion. He is primarily a .Net developer although sometimes has to turn his hand to other technologies such as Java and flex. Simon has also recently started iPhone application development. Contact me.

Sign in