Hi all, I was reading the document and found that there is a statement in chapter "10.2. Making objects persistent" state that
"save() does guarantee to return an identifier. If an INSERT has to be executed to get the identifier ( e.g. "identity" generator, not "sequence"), this INSERT happens immediately, no matter if you are inside or outside of a transaction. This is problematic in a long-running conversation with an extended Session/persistence context. "
I'm wondering what kind of problem can cause by using save() method? or under what situation is not suitable to use save()?
Since save is going to cause a problem in long run, then is it recommended to persist() over save() in all the case that we doesn't require to get the generated id?
Any answer is appreciated
Vince
|