I have gone across the problem,and I really don't know what goes wrong:
this.m_Parent = this.m_Session.Load(typeof(Parent), 1) as Parent;
this.m_Child.SingleParent = this.m_Parent;
his.m_Child.ChildID = 1;
this.m_Child.Name = "Child01";
this.m_Parent.Children.Add(this.m_Child);
this.m_Session.Flush();
I have set the parent objects to cascade "All",and inverse"true" .But when I flush the session.An exception breaks out:
NHibernate.HibernateException was unhandled
Message="SQL insert, update or delete failed (expected affected
row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count."
Source="NHibernate"
While I having none trigger for the database
|