I have noticed, by using log4net, that when calling ISession.Update, it updates all the changed objects.
For example:
Code:
// Change 2 instances
user1.IsDeleted = true;
user2.UserName = "Xyz";
// Call session.Update to update the 2 users
Session.Update(user1); // This updates both user1 & user2.
Session.Update(user2); // Now there is no need for this
Is this the default behavior of NHibernate or has something to do with my mapping file?
Can I make NHibernate update one by one?
Best regards,
Shehab.
Update:I not only call Session.Update(user1) however I call Session.Update() followed by Transaction.Commit(). So after the first commit, both objects are updated in the database.
I need only user1 to be updated in the database after the call of first Commit() then user2 by the call of second commit. Can I achieve that?