Monday 26 March 2007

NHibernate: Object not set to instance on save

When saving I received 'Object not set to instance', from the stack trace the object in question was identified as the VerisionNo.
This was correctly defined for the table in question, after investigation it was identifeid as being a link table that was being flushed which had an existing record with a Null value for the VersionNo.
This record had been either manually entered or entered prior to the versionNo field being defined as NotNull.