-->
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: Transaction save points
PostPosted: Thu Jul 20, 2006 12:59 pm 
Newbie

Joined: Thu Jul 20, 2006 12:53 pm
Posts: 2
Hi guys

Any plans to support transaction save points? (Or is it somehow already supported?!)

I have a data access pattern the employs something called a SessionUsage. It picks up the underlying connection iusing the thread context. This way I can easily flow transactions.

using(SessionUsage usage = new SessionUsage())
{
usage.BeginTransaction(); // savepoint here

// do stuff

usage.CommitTransaction();
}

Now if the SessionUsage gets disposed after beginning a transaction, but without a commit having occured, I want to roll back to the beginning of the save point.

Is there are way of doing this easily, or perhaps a different architecture which would achieve the same thing?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 25, 2006 5:15 pm 
Newbie

Joined: Thu Jul 20, 2006 12:53 pm
Posts: 2
Anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 25, 2006 5:42 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
I think the problem with transaction save points is that the session will no longer be in a consistent state if you roll back the DB transaction, whether or not it's to a save point. If *any* database modification action fails, for whatever reason, you're supposed to throw away the session and start with a new one.

It would be nice if NHibernate supported transactions that covered the in memory state of the objects as well so that they could be rolled back, but I doubt we'll be seeing that anytime soon.

Symon.


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.