473,473 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using System.Transactions.TransactionScope and MSDTC

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
Aug 21 '08 #1
2 4131
On Aug 21, 4:34*pm, "G.S." <gstoy...@gmail.comwrote:
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
Aug 21 '08 #2
On Aug 21, 4:59*pm, "G.S." <gstoy...@gmail.comwrote:
On Aug 21, 4:34*pm, "G.S." <gstoy...@gmail.comwrote:
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
... 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.
Aug 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason Huang | last post by:
Hi, MyForm is a C# Windows Form. MyFom has 3 GroupBoxes. Now I wanna update data from the textboxes in those 3 GroupBoxes. I have function Update1 for GroupBox1 to update table Table1, Update2...
3
by: OUSoonerTaz | last post by:
We are randomly getting this error message on our development and staging machines: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.; at...
1
by: sjoshi | last post by:
Hello I had a question reagrding MSDTC usage. I know that MSDTC will enlist each connection transactions as it's own (take ownership) and commit/abort accordingly. However I'm not sure what...
2
by: Spottswoode | last post by:
Hi I have developed a client/server application in C# that worked perfectly in my office but not so perfectly after deploying it to our client. A little information about the architecture first:...
3
by: =?Utf-8?B?YWJheWVy?= | last post by:
In short: I have an application using the CommittableTransaction class that works fine when run locally, but does not escalate to MSDTC when deployed to a Windows 2003 R2 server. More...
4
by: Bexm | last post by:
Hello I am having problems with the transactionscope that is around alot of the code I have it working fine on our local machines and our Dev server, but when we put it on our live server we get...
3
by: Aleksey Timonin | last post by:
Hi guys, I tried to use TransactionScope on to defferent TableAdapters like this: using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required)) {...
6
by: =?Utf-8?B?ZXhl?= | last post by:
Hi, I'm using TransactionScope to do a serie Insert, Update, Delete operations with the ExecuteNonQuery and some Selects with ExecuteScalar everything works fine with multiple connections in the...
2
by: GaryDean | last post by:
When I use transactions with sql server I usually do this... using (TransactionScope scope = new TransactionScope) { using (SqlConnection1 = new SqlConnection . . . . . and this all works...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.