you can commit the NH's transaction and leave the real action to TS
(Abort/Complete).
Why ?...
Well... you should manage the NH's always and occasionally the NH's will
work in an Ambient-Transaction.
The code where the NH's transaction is managed shouldn't not be aware about
if it is working in Ambient-Transaction or not.
For those using AOP this is pretty normal.

btw, have you tried using the NH's transaction in your tests ?

2010/1/14 HH <[email protected]>

> So you are suggesting that I should use the following:
>
> OnActionExecuting:
> 1) Open Session (if not open)
> 2) CreateTransactionScope
> 3) Start NHibernate Transaction
>
> OnActionExecuted:
> if ([errorsOccured])
>    Rollback NHibernate transaction
> else
>     Commit NHiberate transaction
>     TransactionScope.Complete()
>
> Session will be closed on end request.
>
> This makes me have to manage both the TransactionScope and NHibernate
> transaction.
>
> Why?
>
> Henk
>
> On 14 jan, 22:49, Fabio Maulo <[email protected]> wrote:
> > 2010/1/14 HH <[email protected]>
> >
> >
> >
> > > Do you have any ideas on how to make this work?
> >
> > with an appropriate ActionFilter to manage NH's session, TS and NH's
> > transaction
> >
> > Fabio Maulo
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
>
>


-- 
Fabio Maulo
--
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.

Reply via email to