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: Cascade saves aren't in transactions?
PostPosted: Fri Apr 18, 2008 2:00 pm 
Beginner
Beginner

Joined: Wed Aug 01, 2007 4:28 pm
Posts: 23
Not sure if this is something i'm doing or by design. When I save a parent object, it cascades the saves down. However, in the event of an error, it saves some of the objects in the hierarchy, but not others (the objects it errored on). I would assume normally that the entire save would have been in a transaction, so that either it all saved or nothing. Is this not the case? Do i have to explicitly put my objects into a transaction so that a cascade save is atomic?

Thanks,
Craig


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 18, 2008 3:42 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
You need to create the transaction yourself using Session.BeginTransaction. All actions should be in a transaction to be safe - in fact NHibernate 2.0 enforces this.

Cheers,

Symon

_________________
Symon Rottem
http://blog.symbiotic-development.com


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.