-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problem in long run when using save()
PostPosted: Mon Jan 25, 2010 4:04 am 
Newbie

Joined: Mon Jan 25, 2010 3:49 am
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.