Consider also using SaveOrUpdate() and SaveOrUpdateCopy if
1) The disconnected tier may send a NEW object back, eg. a object that was not extracted from the store
NHibernate is smart enough to know (based on usaved-value="" in mapping) if the object is to be saved or updated
Another one is to use version control or timestamps
SaveOrUpdateCopy() goes further : reconnect the object, look if has to be updated or saved and...if you have an instance loaded in the CURRENT (say it, Business Facade tier) session, that one wil be automatically updated (in memory!!)
NHibernate is great :-)
|