Using the Ghostbusters test
As a 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, we will show you how to detect these "ghost update" issues with the Ghostbusters test.
Getting ready
Complete the Fast testing with the SQLite in-memory database recipe in this chapter.
How to do it...
- 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; ...
Get NHibernate 4.x Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.