I am finding that whenever I load an object from my database it is immediately appearing as being Dirty.
I found some code that will let me see if the object is dirty here: http://nhforge.org/wikis/howtonh/finding-dirty-properties-in-nhibernate.aspx
var x = session.Get<MyRecord>(123);
var dirtyEntity = session.IsDirtyEntity(x);
dirtyEntity is always evaluating to true to entities of this class.
Looking into it a bit more I think I've found the root of the problem. I have a property which is mapped onto an nchar(15) column in SQL Server. The value in the DB has trailing spaces, but the value appearing on the object has been trimmed. So... the following is returning true.
var x = session.Get<MyRecord>(123);
var dirtyProperty = session.IsDirtyProperty(x, "Status");
Does anyone know how I can get nHibnernate to say that "Status OK" and "Status OK " are equivelent, and that the entity is not dirty?