-->
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: When flushing session?
PostPosted: Mon Jul 19, 2010 5:36 am 
Newbie

Joined: Sat Mar 27, 2010 11:51 am
Posts: 6
Hi Guys,

I would know when it's the proper moment to flush session?

for example:

1) have a loop on a list, and I have to update , flush inside the loop or after?

2) In a simple transaction as inser/update/delete have I to flush before the commit or can avoid this?



Thanks a lot for your answeers


Top
 Profile  
 
 Post subject: Re: When flushing session?
PostPosted: Mon Jul 19, 2010 9:38 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
You don't have to do an explicit flush before a commit. You could do a flush when some of your fields are filled by a trigger or something and you need these values before the end of the transaction. Flush and clear is useful if you have to process a large number of entities and run into memory problems.


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.