To me it looks like an issue with the utilization of the session manager. I use 
rollback with nhibernate 2 and don't have any side effects.  Can you post more 
of your code?

Thanks.

Philip Japikse, MCSD.Net, MCDBA, CSM
Pinnacle Solutions, Inc
[EMAIL PROTECTED]
www.japikse.blogspot.com
twitter/skimedic
(513) 312-5664
(sent from mobile device)

-----Original Message-----
From: Jeff Brown <[EMAIL PROTECTED]>
Sent: Saturday, December 06, 2008 17:45
To: [email protected]
Subject: MbUnit Re: multiple tests and RollBack2

Why not put Rollback2 everywhere?

I don't really know why this is happening.  The MbUnit Rollback feature works 
by creating a new ambient transaction and then rolling it back using the 
System.Transaction APIs in .Net 2.0.

Participation in System.Transaction is optional.  So if NHibernate creates its 
own brand new transaction when you add the row instead of enlisting in the 
current transaction then the Rollback feature cannot have any effect.

If I recall correctly, you have both the option of starting a new transaction 
and of enlisting in the current one given an NHibernate session.  That might 
have an impact on whether the ambient transaction gets involved.  Not sure.

This issue might also be related: http://jira.nhibernate.org/browse/NH-754

Jeff.

On Fri, Dec 5, 2008 at 12:39 PM, suedeuno <[EMAIL PROTECTED]> wrote:

 I created a couple of tests that saves an object and it's using
 NHibernate. The second test has [Rollback2] attribute. (using
 Resharper to run tests)

 I've noticed that if I run the test without rollback prior to the test
 with rollback, then the row doesn't get deleted in the test with
 Rollback but a row gets inserted using the values of the previous
 test. How do I stop this from happening?





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" 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/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to