I've just begon using Transactions in .NET and I have a problem. In a function (in my DAL) I use a transaction scope. On the end of the function I trigger the Complete() function.
Now I have a test for this function which also uses a transaction scope. On the end of this test function I do not trigger the complete() function so that my test doesn't fill the database with test data. This seems to be working fine.
My problem now is that if I do trigger complete() in my test function, the transaction seems to be completed twice. This seems logical as I trigger Complete() twice... but is there a way to avoid this? Is there a way to trigger the Complete() function twice without executing the scope twice... Sure there must be a way to nest transactions...?