It seems that whenever NHibernate gives an Exception, I get the error message "null id in <ClassName> entry (don't flush the Session after an exception occurs)". As far as I can tell, this will occur for any failed sql insert statement whether an identity column isn't set, a column name is incorrect, string or binary data would be truncated, inserting null into a non-null column, or any other SQL Server level exception.
The exception has no inner exception and a useless error message. Is there any way to get the actual error message for the exception (the original "String or Binary data would be truncated")?
I'm using NHibernate 2.1.1 GA.
|