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: why use the update method when flush() does the same thing?
PostPosted: Sun Nov 14, 2004 8:28 pm 
Newbie

Joined: Sun Aug 08, 2004 11:04 pm
Posts: 5
Hi, If calling session.flush() generates the sql update command, why bother calling session.update(myobject)?

Note, I am not using a transaction.

Does the difference come into play with the save() method, the saveOrUpdate() method, or cascading save/updates? I don't get it????

What scenareo would there be that would require you to use update() before flush()?

Troy


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 14, 2004 10:02 pm 
Regular
Regular

Joined: Fri Nov 12, 2004 12:07 am
Posts: 57
Location: Beijing,China
when you get a persist object from session one,after session one closed,you changed some states of the object, for save the object,
you must create a new session (session two) and call the update() of session two.


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.