2009/6/29 Brian Sullivan <[email protected]>: > > Oskar, > > Thanks for the reply! Yes, it looks like calling ToList() does cause > the update to happen as well (once I call session.Flush()). I'm not > sure if anything is actually being updated, since unfortunately SQL > Profiler doesn't provide the values for the "@" params in its
This should be a matter of enabling the correct columns in the profiler, though at this time I don't remember which. Use can also enable logging using log4net. Set level for NHibernate.SQL to DEBUG, this will make it output all SQL queries, including parameters. With DEBUG logging for all NHibernate perhaps you can also see where it detects the dirty object. Though other approaches may be easier to try first. > display. I'd have to check the values in the table. However, the > fact that an UPDATE is being issued at all is cause for concern. > > You mentioned NULLs in varchar columns being a potential problem. I > know for certain that some of the varchar fields in the Contacts table > are nullable. How can I verify that this is indeed what's happening > to cause the update, and how can I best address it? They shouldn't magically change of course, just by being NULL. Do you have something in your class that might not give the same value back after being set, for some value? Can you post your class and you mapping? As for the NULL varchar, a brute force method would of course be to set them all to the empty string in one go, then all NULL in another go. Run your test inbetween to see if it still updates anything. But I think you should first try to get some SQL logs from NHibernate. /Oskar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
