-->
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: Flush time
PostPosted: Tue Oct 13, 2009 7:34 am 
Newbie

Joined: Tue Oct 13, 2009 7:30 am
Posts: 6
I read the following:

Changes to "Persistent" instances are detected at FLUSH TIME and result in a SQL [UPDATE] ---> [saveOrUpdate()].

What is meant by the "Flush time"?

Thanks.


Top
 Profile  
 
 Post subject: Re: Flush time
PostPosted: Thu Oct 29, 2009 4:13 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
flush time is the point at which the engine decides that it need to synchronize your changes to the db and actually execute the sql.

i.e. you could call session.save(object1), session.save(object2), .....session.save(objectn) and if you were tracing the sql you wouldn't actually see any inserts executed.

However, if you were to turn around and select from that table with FlushMode.AUTO on then the hibernate engine would detect that you have changed entities in the table set you are querying and trigger the insert sql prior to executing the fetch. The same sort of behavior can be forced by manually calling the flush.

_________________
Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.


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.