TransactionScope Questions

R

Rick

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!
 
M

Mary Chipman [MSFT]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top