> I want to have something like sub-transactions, in that you can mark a point > where you would start the sub-transaction, then at the point of descision > for that bit, you can either roll-back (abort the sub-bit) or carry on, > effectively commiting, when the out transation commits. > Of course, if you abort the outer transaction, the marked bit aborts too. > > How can I do that with NHibernate. Can I have an example please.
this might help: http://stackoverflow.com/questions/2670052/achieving-nhibernate-nested-trans actions-behavior I think NHibernate doesn't support nested transactions because 1) ado.net also doesn't do that and 2) the session is an abstraction of the underlying transaction: you don't really control when what starts and ends (to some extend of course), which is typical for a unit of work. low-level constructs like save points on a live ado.net transaction object might be a good addition, although not all databases support those and in general it's not really something one would use in general, as the logical behavior would be: you collect work to be performed in a unit of work and then you perform it in 1 go: semantically, what does it mean if a part of the work rolls back however it doesn't affect the rest? isnt that the same as that the sub-part really isn't part of the general transaction at all? To me it seems that way. FB ------------------------------------------------------------------------ Creator / Lead developer of LLBLGen Pro, the O/R mapping designer for .NET LLBLGen Pro runtime framework, NHibernate, Linq to SQL, Entity Framework LLBLGen Pro website: http://www.llblgen.com Blog: http://weblogs.asp.net/fbouma. Twitter: http://twitter.com/FransBouma Microsoft MVP (C#). ------------------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
