Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TransactionScope and SQL Server Locks
Message
From
10/04/2012 13:16:03
 
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01540816
Message ID:
01540833
Views:
39
>>>>>I would use ReadUncommitted Transaction Isolation Level and don't use Transactions in your code at all (you don't need them for selects).
>>>>>
>>>>>I recommend these blog posts by Dmitri Korotkevich (new SQL Server MVP):
>>>>>http://aboutsqlserver.com/2011/09/28/locking-in-microsoft-sql-server-table-of-content/
>>>>>
>>>>>They explain all these things in relatively simple terms.

>>>>
>>>>Thanks Naomi, I'll read his blog. BTW, I'm not using any additional Transactions in code, just the TransactionScope.
>>>>
>>>>I also wondered about the Distributed Transaction question I asked:
>>>>
>>>>>>Complicating all this is the fact that most of our other Transactions to our own databases get elevated to Distributed Transactions at some point. I'm pretty sure that this would NOT apply to the above Transaction to our customer's database, since I've made it RequiresNew, but I don't know for sure as it would be called in the middle of a distributed transaction.
>>>>
>>>>Any comments about that?
>>>>
>>>>~~Bonnie
>>>
>>>I understood you're only doing select statements. Are your statements put in the middle of a bigger process that does updates across multiple databases?
>>
>>Yes, that was stated in the last paragraph in my original post (what I quoted above). This is a new Transaction (TransactionScopeOptions.RequiresNew) ... therefore, I assumed that it would not be dragged into the ambient distributed transactions. Is this a valid assumption?
>>
>>~~Bonnie
>
>From the point of SQL Server, if one transaction is started and not yet committed, everything that starts in the middle of it will be part of that transaction. I am not sure how distributed transactions work in .NET, but I assume this would hold true also.

And I assumed the opposite ... <g> Assumptions aren't going to get me anywhere at this point ... <g>

Anyway, that's why I'm trying to find out for sure. I'll probably have some additional testing that I'm going to have to do, but I was hoping that I might get some answers to point me in the right direction ... less testing for me that way.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform