2009/7/1 Fernando Zago <nan...@gmail.com>: > I made the changes in the entity, but i don't want that nhibernate persist > them. > I want nhibernate to persist what is cascade="save-update".
The cascade has to do with your root having or gaining reference to objects that are not already persisted, or that aren't "owned" by your ISession. For example, if you load a region from the database and do region.Country = new Country(), then cascade="save-update" will cause NHibernate to automatically persist the Country instance, but with cascade="none", the new Country will no be saved. However, if you Country is already owned by an ISession, it is dirty-tracked regardless of any references to it. I try to follow the principle that a persisted object is a persisted object. Don't change it if you don't want to persist the changes - at least unless you can rollback the whole transaction or unit-of-work. If you really have to change the Country, perhaps you could experiment with evicting it from the session first. /Oskar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---