-->
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: Is there a way to "disconnect" an object for editing?
PostPosted: Mon Jun 28, 2010 12:36 pm 
Newbie

Joined: Mon Jun 28, 2010 12:27 pm
Posts: 1
Hi,

I am building a JSF web app that uses Hibernate for persistence. It's working very well. Hibernate is awesome.

I issue a query and get an object that I want to let the user edit. The user makes some changes to the object. I then need to issue some hibernate queries. The user hasn't indicated to "save" the changes so I don't yet want to store the changes. I'm finding that even though I haven't told hibernate to save the object the user is editing, Hibernate is automatically issuing an UPDATE to persist the changes the user made when I issue my other queries.

I turned on the Hibernate debugging to see the SQL queries that Hibernate issues. This is very useful in helping me understand what's going on.

I'm wondering if there is a way to tell Hibernate to "forget" about an object that I've retrieved for the user to edit. Then when the user clicks "save" I'll reconnect the Hibernate object and save it. If the user never clicks save, then the database will remain unchanged.

Any suggestions on how to implement this?

Thanks,
John


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.