I have some business logic that executes within a simple TransactionScope:
using (var scope = new TransactionScope())
{
// does some logic.
// then some more...
scope.Complete();
}
During execution an ADO exception occurs and the transaction is on it's way to being disposed.
In the meantime the exception is captured further upstream, and I try to log it to my database, via another connection.
At this point I get another error saying The operation is not valid for the state of the transaction.
Eeek!
Now I can see I am able to use IsolationLevel, to change the way my transactions interact, but is this the right thing to do? And which should I use?