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: change a field after save before flush
PostPosted: Fri Mar 07, 2008 11:01 am 
Newbie

Joined: Wed Feb 27, 2008 4:22 pm
Posts: 4
I am trying to update a field just after the save in a transaction. I see that the flush is not called and my assumption is since the object got updated the new value should be used when it tries to insert into the database.

But I see that in the insert the old value is being used and I see an update occuring later on.

The question is , if I update a field just after I call a save on a object, will it take in any new changes to the object before it synchonizes with the database.(it before the flush).

The reason I am doing this is I am using a ID generator on one of the fields on the parent. When I call the save the ID gets generated. I want to use the ID generated and populate it on a child object before the entire object is stored in the database.


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.