-->
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: saveOrUpdate for detached objects
PostPosted: Tue May 31, 2005 3:23 am 
Beginner
Beginner

Joined: Sat May 07, 2005 12:01 pm
Posts: 33
I have thew following scenario in a Web application: I'm loading a complex object graph, then close the session -- the loaded objects are now detached. The user edits some of the objects. Now I want to persist the saved objects back to the database -- it appears a cascading saveOrUpdate would be the best choice. However, according to the doc, this method will save every object in the graph, regardless of whether it was actually modified (and no, I don't want to use "select before update"). Is there a way for Hibernate to just update objects that have actually been modified? I'm assuming the answer is "no" for detached objects, since I'm guessing the previous state is maintained as part of the 1st level cache, which vanishes as soon as I close the session from which I loaded my objects.

Any ideas?

Thanks!

Jen


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.