Hello

This is rare situation but is that bug or feature?

I have detached object with lazy details something like

public class Ent
{
      public virtual ISet<XDetails> Details
        {
            get
            {
                return (_details ?? (_details = new HashSet<XDetails>()));
            }
            protected set { _lines = value; }
        }
        private ISet<XDetails> _details;

Nhib 3.3mapped to access _details directly, not by Details property

Instance of Ent exists in DB and have no details

I need to update instance by data coming from GUI; 
no detail was created in GUI

as result before calling Merge ent._details == null
when flushing session -> exception "A collection with 
cascade="all-delete-orphan" was no longer referenced ....." 

If before calling merge, initialize _details with empty collection (access 
property for example) - all is OK.

During merge Nhib instantiate new instance of Ent, load it from DB, and 
then copies property values from given obj to newly loaded.
During instantiation Nhib initialize _details collection by it's internal 
Persistent coll wrapper.
During copy process it copies _details (==null) to newly instantiated 
object.
So empt collection created during instantiation & load become not 
referenced....and this is source of exception.

Is that bug or not?


-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to