|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TransactionScope QuestionsHi! I have a couple of questions about TransactionScope...
What exactly is the scope of a transaction? Is it only connections that are created in the actual code block where the TransactionScope is defined, or is it all connections created on the same thread as the TransactionScope? What is the performance like using a TransactionScope object for multiple consequetive connections to a single database as compared to using a standard ADO.NET transaction object? I'm guessing it would be slower... but by how much? Thx! Yes, connections need to be opened inside of the TransactionScope.
It's well-documented -- go to msdn2.microsoft.com and search. TransactionScope is part of the System.Transactions namespace, which is intended for distributed transactions involving multiple resource managers. You probably don't need the additional overhead if you simply want to wrap multiple operations as a single unit of work in a database. What is the scenario for wanting to involve multiple connections? --Mary Show quote On Sat, 20 Jan 2007 11:05:24 -0800, "Rick" <rick@nospam.com> wrote: >Hi! I have a couple of questions about TransactionScope... > >What exactly is the scope of a transaction? Is it only connections that are >created in the actual code block where the TransactionScope is defined, or >is it all connections created on the same thread as the TransactionScope? > >What is the performance like using a TransactionScope object for multiple >consequetive connections to a single database as compared to using a >standard ADO.NET transaction object? I'm guessing it would be slower... but >by how much? > >Thx! > |
|||||||||||||||||||||||