-->
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: Session.flush() and Session.close()
PostPosted: Mon Apr 19, 2004 9:15 pm 
Regular
Regular

Joined: Thu Apr 15, 2004 1:12 pm
Posts: 55
Why does Session.close() not do a flush? I assume this must mean there must be some situation where you'd want to close without flushing, but I can't imagine what that might be...

thanks,
mark


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 1:55 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
commit executes a flush because you explicitly "want" the changes to be persisted .
But session.close just mean you discard the current session.
If you trap an exception, then you may want to stop and forgive all the changes you've done, so you'll call rollback + close to release connexion


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.