O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Using a second level cache

In this exercise, we want to implement a very simple application which uses NHibernate's second level cache. We use the hashtable cache provider in this exercise, but please make sure that you are never using this provider in the production level code!

  1. Open SSMS and log in to your local SQL Express database.
  2. Add a new database named SecondLevelCacheSample to the database server.
  3. Open Visual Studio and create a new Console Application named SecondLevelCacheSample.
  4. Add references to the NHibernate.dll, FluentNHibernate.dll, and NHibernate.ByteCode.Castle.dll assemblies located in the lib folder.
  5. Create a folder Domain in the Project.
  6. Add a class file, Product.cs, to the Domain folder of the project.
  7. Add the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required