If the objects were loaded in the same session, then the session is keeping track of changed objects and update only the changed ones. But in your case the objects are not associated with this session.
You could track the changed objects yourself and save or update the changed ones. NHibernate cannot help you there.
Or you could try and implement Session per Conversation pattern and keep the objects in one session over multiple requests.
As a side note you could use the ISession.SaveOrUpdate(Object) method instead of the if statement. The session will do it for you ;).
Bojan Milenkoski
2009-07-17 09:03:13