Using System.Transactions.TransactionScope and MSDTC

  • Thread starter Thread starter G.S.
  • Start date Start date
G

G.S.

Is there a way to use transactions from within C# code without using
MSDTC (client-and-server environment where the SQL server is behind a
firewall)?

Thank you
 
Is there a way to use transactions from within C# code without using
MSDTC (client-and-server environment where the SQL server is behind a
firewall)?

Thank you

I guess I'll reply myself :)

If the target database is SQL 2005 and certain conditions are met, the
TransactionScope will stay "light-weight" and will not be promoted to
a full-blown MSDTC transaction.

From reading this up quickly it looks the condition is to only create
the DB connection once and pass it around throughout the body of the
transaction.

Would somebody comment if there's a way to explicitely request a LWT
since I know I only hit ONE SQL Server 2005.

Thanks
 
I guess I'll reply myself :)

If the target database is SQL 2005 and certain conditions are met, the
TransactionScope will stay "light-weight" and will not be promoted to
a full-blown MSDTC transaction.

From reading this up quickly it looks the condition is to only create
the DB connection once and pass it around throughout the body of the
transaction.

Would somebody comment if there's a way to explicitely request a LWT
since I know I only hit ONE SQL Server 2005.

Thanks

... another condition that some posts on the internet hint may trigger
escalation to a distributed transaction seems to be usage of aliases
instead of the SQL server instance name.
 

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

Back
Top