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.
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> _inconclusiveCallback; public Ghostbusters(Configuration configuration, ISessionFactory sessionFactory, Action<string> failCallback, Action<string> inconclusiveCallback) { _configuration...