You can see that the methods merge()and save()calling the method save()inside, the difference in their behavior, i.e. if you store an object in an HTTP session and later want to access it, but this object has lost its constant context, the merge () method merges the state of an individual object back into the current Hibernate session. But if you call the save () method on an individual object, you will encounter a sexual exception ( org.hibernate.LazyInitializationException), as you mentioned. For more information, documentation .
source
share