Time for action – Causing a phantom update
In this exercise, we want to create a situation where NHibernate creates a phantom update. The cause of the phantom updates will be an inconsistency between the database table column and the respective property of the entity. In the database table, the column is defined as nullable, but the corresponding property of the entity is not nullable. We have to "cheat" and use some SQL bulk operation to prepare our data the way that the scenario is possible. Let's start now.
- Open Visual Studio and open the
- Add a new Console Application type project to the solution. Call the project
- Add references to
FluentNHibernateto the project. ...