A test case should show us if it is a bug or something wrong in your-code/DB-state
On Thu, Feb 3, 2011 at 1:26 PM, Trinition <[email protected]> wrote: > Looking at this again today with fresh eyes, and applying NHProf and > some ghost-busting intercepting, here's what I notice. I start a unit > of work, Get the Contact, then Commit. When I get the contact, only > the contact is loaded (select ... from Contacts ...). When I step on > commit, with no data changed, I see the following pattern in NHProf: > > SELECT ... FROM ContactAddresses left outer join Addresses ... WHERE > ContactID=1 > DELETE FROM ContactAddresses WHERE ContactID=1 > INSERT INTO ContactAddresses (ContactID, AddressTypeID, AddressID) > VALUES (1, 1, 270) > > 1. Why is it loading this collection on commit? I've not accessed the > getter for the collection. The collection is set to lazy load. I > would expect NH to not need to ever load this collection when I just > Get the Contact and do nothing to it. > > 2. It's not just deleting each item in ContactAddress for this contact > one-by-one... it's deleting them ALL for that contact in one > statement. Is NH smart enough to coalesce when it seems all items in > a collection are to be delete that it intelligently deletes them all, > or is this a sign that it's not the individual collection elements > that are ghostly dirty, but something with the collection itself? > > On Feb 2, 10:30 pm, Trinition <[email protected]> wrote: > > > > I'm going to re-trace my steps to make sure I didn't miss anything. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
