-->
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.  [ 3 posts ] 
Author Message
 Post subject: When to use Transaction API instead of simple Flush()?
PostPosted: Tue Jul 31, 2007 1:11 pm 
Newbie

Joined: Tue Jul 31, 2007 1:00 pm
Posts: 2
Hi, I'm sure this has been answered before but I can't seem to find any clear answer. As I understand it, a call to ISession.Flush() will execute any insert/update/delete statements within a transaction, so that if one fails all are rolled back. In what situation would I actually need to start my own transaction and use the Comit()/Rollback() methods, rather than just using Flush() and having the transaction handled automatically?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 31, 2007 1:35 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Transactions are not started unless you explicitly start them. A flush is not atomic unless you have created a transaction first.

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 31, 2007 2:13 pm 
Newbie

Joined: Tue Jul 31, 2007 1:00 pm
Posts: 2
Oh, ok. I thought flush was Atomic. Good to know.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.