Regardless of Oren's 2 year old blog post being non-canonical (and subject
to misinterpretation), the fact is that NH only creates transaction
explicitly, and they should always be used.
Could this be made easier? Maybe. It was even discussed in this list a while
ago, and there's a Jira ticket for it: http://216.121.112.228/browse/NH-2181
<http://216.121.112.228/browse/NH-2181>But it is what it is...
Diego
On Thu, Nov 4, 2010 at 13:26, Eldritch Palmer <[email protected]>wrote:
> Just as a follow up see also this post by Ayende (http://ayende.com/
> Blog/archive/2008/12/28/nh-prof-alerts-use-of-implicit-transactions-is-
> discouraged.aspx)
>
> where at the end of the main text and also in the comments he implies
> (as far as I'm concerned) that you do not need to explicitly manage NH
> transactions if you use TransactionScope.
>
> He also indicates you do not need to Flush() in a TransactionScope
> because NH will handle that, but that just results in the behavior I
> described in the initial post. (note that it does work in non-
> distributed cases).
>
> Note that I'm not trying an argument from authority here nor am I
> trying to put words in Ayende's mouth, but nothing that he's written
> about NH and TransactionScope has lead me to believe you need to
> explicitly manage NH transactions in tandem with TransactionScope
>
>
>
> On Nov 4, 4:43 pm, Eldritch Palmer <[email protected]> wrote:
> > Diego,
> >
> > Doesn't that completely fly in the face of what TransactionScope is
> > supposed to do?
> > The whole point of transactionscope is exactly that you don't need to
> > explicitly manage transactions.
> >
> > If you check the thread I refer to in my original mail you'll see that
> > Ayende considered that behavior a bug that could be worked around by
> > using explicit transactions (http://www.mail-archive.com/rhino-tools-
> > [email protected]/msg02447.html).
> >
> > I don't see how having to use explicit transactions is a good thing.
> >
> > If there's any point in continuing this then I'd be more than happy to
> > continue on nhusers.
> >
> > On Nov 4, 3:52 pm, Diego Mijelshon <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > NHibernate will automatically enlist its transactions in the
> > > transactionscope, BUT you still have to open them.
> > > (BTW, this group is for the development of NH; use nhusers for usage
> > > questions)
> >
> > > Diego
> >
> > > On Thu, Nov 4, 2010 at 11:24, Eldritch Palmer <
> [email protected]>wrote:
> >
> > > > Oskar,
> >
> > > > I'm currently not explicitly opening any NH transactions.
> > > > As far as I can tell NHibernate should automatically enlist in the
> > > > transaction created by the transactionscope.
> > > > If this is not the case then that would be a pain (that is what I
> was
> > > > referring to in my initial post)
> >
> > > > Can you reproduce the issue?
> >
> > > > Eldritch
> >
> > > > On Nov 4, 2:57 pm, Oskar Berggren <[email protected]> wrote:
> > > > > Where are you opening you NHibernate transactions?
> >
> > > > > /Oskar
>