-->
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: synch NHibernate without commiting transaction
PostPosted: Mon Aug 15, 2005 1:24 pm 
Hi,

How can I do this using NHibernate?

1) Begin a transaction
2) Create a User object + save it to the database, BUT don't commit the database transaction.
3) In a SQL query, find User object (using Session.Find method)
4) Do some more work that causes an error
5) Because of error, rollback all work, including User object created in step 2).

Basically, I want to know if it is possible to commit work to DB without commiting the transaction using NHibernate? Does anyone do this sort of thing?

Thanks,

Jon Paugh


Top
  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 4:07 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Yes, it's possible. ISession.Flush does exactly this, and ISession.Find calls Flush internally to ensure that it retrieves correct results.


Top
 Profile  
 
 Post subject: thanks
PostPosted: Mon Aug 15, 2005 4:42 pm 
very nice thanks.


Top
  
 
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.