-->
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.  [ 2 posts ] 
Author Message
 Post subject: newbie: saveOrUpdate on detached object
PostPosted: Tue Dec 13, 2005 5:50 pm 
Newbie

Joined: Tue Dec 13, 2005 5:43 pm
Posts: 5
hello,
sorry for asking a basic question, but I have not found any answer for it anywhere...

I have a detached object on which I have made alterations after the session was closed. The object contains a collection of other objects, and I have added one object to that collection.
When I create a new session, do a saveOrUpdate on the detached object and commits the transaction, the object (with changes to it's collection) is saved to the database. How come? I thought it was only possible to save persistent objects!?

Any help or links to relevant documentation would be highly appreciated.

best regards,
kenny


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 6:26 pm 
Beginner
Beginner

Joined: Tue Dec 28, 2004 11:30 am
Posts: 32
According to the Hibernate in Action book ,
calling update on a detached object will reassociate the detached instance to the new session and tells Hibernate to treat the object as dirty.
So the object being dirty its persistant state will be updated if changes exist

Again that's my undrestanding


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

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.