|
From: NHibernate J. <mik...@us...> - 2006-11-29 07:51:39
|
Using Criteria to query for an item throws on Flush in some situations
----------------------------------------------------------------------
Key: NH-826
URL: http://jira.nhibernate.org/browse/NH-826
Project: NHibernate
Type: Bug
Components: Core
Versions: 1.2.0.Beta2
Reporter: Aaron Jensen
Priority: Blocker
Attachments: NHibernateTest.zip
The situation is best described by the attached sample project, but I will attempt to explain in words when this problem occurs.
EntityA has a many-to-many to EntityB
EntityB has a subclass EntityC
EntityC has a one-to-many to EntityD
If you create an EntityB and associate it to EntityA, then query for EntityA via Criteria (but not via HQL) then Session.Flush() will fail with:
NHibernate.HibernateException: You may not dereference an collection with cascade="all-delete-orphan"
at NHibernate.Impl.SessionImpl.UpdateUnreachableCollection(IPersistentCollection coll) in c:\net\nhibernate\nhibernat
e\src\NHibernate\Impl\SessionImpl.cs:line 3957
at NHibernate.Impl.SessionImpl.FlushCollections() in c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionImpl.cs:
line 3802
at NHibernate.Impl.SessionImpl.FlushEverything() in c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionImpl.cs:l
ine 3090
The collection it is complaining about is a collection of EntityD objects which should never have been created in the first place.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|