Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Catch 22
Message
 
 
To
03/09/2013 21:24:20
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01581904
Message ID:
01582691
Views:
61
>>Say, I do want a transaction and I do want everything to happen, but at the end, I don't want to commit it. Do I simply omit scope.Complete() and expect it will be rollbacked at the end of the using statement?
>
>Yes, if there is no scope.Complete(), then it all gets rolled back!
>
>~~Bonnie

It doesn't seem to work this way :(

This is my code:
 String result = "";
         middlewareMain.Rollback = false;
         using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted }))
         {
            result = middlewareMain.Invoke(input);
         }
         middlewareMain.Rollback = true;
The method inserts new rows into database and I do actually have these rows now. Do you know what may be the problem?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform