code_junkie

Nullable Property Causes Errors When Null in NHibernate

Nov 12th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. <property name="OwnerId" column="OwnerID" type="System.Int32" not-null="false" />
  2.  
  3. [SqlException (0x80131904): Column name 'ModuleAnchorID' appears more than once in the result column list.]
  4. System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +925466
  5. System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800118
  6. System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
  7. System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
  8. System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
  9. System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1005
  10. System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
  11. System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +149
  12. System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
  13. NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation expectation) +35
  14. NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session) +1055
  15.  
  16. [PropertyValueException: not-null property references a null or transient value:]
  17. NHibernate.Impl.SessionImpl.CheckNullability(Object[] values, IEntityPersister persister, Boolean isUpdate) +224
  18. NHibernate.Impl.SessionImpl.FlushEntity(Object obj, EntityEntry entry) +1019
  19. NHibernate.Impl.SessionImpl.FlushEntities() +182
  20. NHibernate.Impl.SessionImpl.FlushEverything() +90
  21. NHibernate.Impl.SessionImpl.AutoFlushIfRequired(ISet querySpaces) +64
  22. NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria, IList results) +217
  23. NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +42
  24. NHibernate.Impl.CriteriaImpl.List() +29
Add Comment
Please, Sign In to add comment