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 – 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.

  1. Open Visual Studio and open the Chapter11 Samples solution.
  2. Add a new Console Application type project to the solution. Call the project PhantomUpdates.
  3. Add references to NHibernate, NHibernate.ByteCode.Castle, and FluentNHibernate to the project. ...

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