O'Reilly logo

NHibernate 3.0 Cookbook by Jason Dentler

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

Using the Ghostbusters test

As part of automatic dirty checking, NHibernate compares the original state of an entity to its current state. An otherwise unchanged entity may be updated unnecessarily because a type conversion caused this comparison to fail. In this recipe, I will show you how to detect these "ghost update" issues with the Ghostbusters test.

Getting ready

Complete the recipe Fast testing with SQLite in-memory database.

How to do it...

  1. Add a new class named Ghostbusters using the following code:
    private static readonly ILog log = LogManager.GetLogger(typeof(Ghostbusters)); private readonly Configuration _configuration; private readonly ISessionFactory _sessionFactory; private readonly Action<string> _failCallback; private readonly Action<string> ...

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