Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the usage of Session.Merge method in NHibernate?

What is the usage of Session.Merge method in NHibernate?

When can we use of this method?

like image 848
masoud ramezani Avatar asked Jun 18 '11 15:06

masoud ramezani


1 Answers

Try look here:

NHibernate - Difference between session.Merge and session.SaveOrUpdate?

from the above post:

You should use Merge() if you are trying to update objects that were at one point detached from the session, especially if there might be persistent instances of those objects currently associated with the session. Otherwise, using SaveOrUpdate() in that case would result in an exception.

like image 104
danyolgiax Avatar answered Oct 07 '22 20:10

danyolgiax