I am having a similar problem.
I have a child parent relationship, and a FK in the database.
My xml mapping files are essentially the same.
In the parent xml file I have.
Code:
<bag name="Child" lazy="true" cascade="all-delete-orphan">
<key column="parentid"/>
<one-to-many class="RightRez.DBLibrary.dbo.Child, DBLibrary"/>
</bag>
In the child I have:
Code:
<many-to-one name="Parent" column="parentid" class="RightRez.DBLibrary.dbo.Parent, DBLibrary" not-null="true"/>
When I delete, I have tried to do a session.Delete(c) for all children of hte parent, and then session.Delete(p).
I have also tried just a straight session.Delete(p)
Both times I get a FK constraint error. When looking at the log, it shows that it does an update (before any deletes) of a child, and sets the parentid of the child to null??? I am NOT doing a Remove call. So what the heck is going on. I have played around with many different cascade rules, and have tried turning inverse off and on.
Any help would be appreciated!