views:

35

answers:

2

for reference I'm using version 2.1.2.4000 of Nhibernate.

I've spent pretty much an hour or so reading up the difference between Merge() and SaveOrUpdate() and no explanation attempts to just answer a really simple question??

I know that Merge() will do all the magic to synchronize the detached objects with cached or out of date instances.

BUT, once I've "merged", and I do not intend to change the entity any longer...

Do I have to Still Call SaveOrUpdate?

cheers

A: 

Answer here: http://stackoverflow.com/questions/170962/nhibernate-difference-between-session-merge-and-session-saveorupdate

Pierre 303
that's quite an unhelpful answer. have you read either question fully? and have you read the other answer fully? take particular note of the second comment in the chosen answer.
andy
Sorry, that was pretty clear to me, but Petr copied the same URL and gave you some details.
Pierre 303
yep, the clarification and clarity was what I needed
andy
+2  A: 

Check another thread. The point is that Merge() just puts together states from the session (from the database) and your detached object. You then should not use detached object any more but use newly returned object from the session that was merged. This object, of course, has to be "saved or updated" in order to persist changes because it has changed due to Merge operation.

Petr Kozelek
dude, life saver!
andy