473,750 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Should I use TransactionScop e?

Hi,

I'd really like to use TransactionScop e within the Business Layer of
my web application. A book I'm reading makes a note that it should not
be used in a shared web hosting environment because the server may get
re-configured. Can anyone elaborate on this?

Regards,

Chris

May 10 '07 #1
4 5555
Chris,

I don't see how the server becoming reconfigured affects the use of
TransactionScop e.

You want to use the TransactionScop e class when you want the code
encapsulated in the scope of the instance (it's meant to be used in a using
statement) is to run in a transactional context.

Look at the documentation for the TransactionScop e class on how to use
it.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<ha******@hotma il.comwrote in message
news:11******** **************@ e51g2000hsg.goo glegroups.com.. .
Hi,

I'd really like to use TransactionScop e within the Business Layer of
my web application. A book I'm reading makes a note that it should not
be used in a shared web hosting environment because the server may get
re-configured. Can anyone elaborate on this?

Regards,

Chris

May 10 '07 #2
I don't see how the server becoming reconfigured affects the use of
TransactionScop e.
Maybe if DTC is disabled... but by that note, virtually everything is
a contender... almost *any* configuration change could potentially
break something... all our code will always be at the mercy of the
services that the OS and runtime provide

Marc

May 10 '07 #3
"Marc Gravell" <ma**********@g mail.comwrote in message
news:11******** *************@e 65g2000hsc.goog legroups.com...
> I don't see how the server becoming reconfigured affects the use of
TransactionSco pe.

Maybe if DTC is disabled... but by that note, virtually everything is
a contender... almost *any* configuration change could potentially
break something... all our code will always be at the mercy of the
services that the OS and runtime provide
Actually, TransactionScop e is supposed to work even if DTC is
disabled/uninstalled, as long as you don't do anything that causes
promotion. I've actually got an open bug report on Connect about this (i.e.
it failed for me when DTC wasn't installed), but I've been communicating
with a tester at MSFT who's working on the bug and he can't get it to
reproduce. Indeed, when I tried to repro it myself, I couldn't do it
either - as long as the transaction doesn't need to be promoted, DTC should
not be required.

-cd
May 10 '07 #4
Correct; but the OP didn't specify an RDBMS; only MS SqlServer 2005
supports promotable transactions; prior to this you will get DTC
immediately, without promotions even being an issue.

Marc
May 11 '07 #5

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

Similar topics

4
2055
by: Rick_Kierner | last post by:
I am attempting to use the TransactionScope class to manage my transactions. I am running into an issue. My web server is in an NT work group. My SQL Server is in a domain. When my code attempts to execute the Complete method of the TransactionScope object, I get the following error: "The transaction has already been implicitly or explicitly committed or aborted" I have tried altering the registry entry to...
0
1959
by: ste | last post by:
Please bear with this post.. its abit long winded.. but i thought it was important to describe what i am trying to achieve before i ask the questions (at the bottom) Thanks.....in advance Steve Okay.. here goes..................
3
7120
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 System.Data.Common.UnsafeNativeMethods.OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans) at System.Data.OracleClient.TracedNativeMethods.OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans)
6
1773
by: Mukesh | last post by:
Hi, I am new to 2.0 framework. I am trying to use TransactionScope in the following code. I took four lables. Started TransactionScope scope. After setting values to three labels I throw an exception. I expexted all label value would remain as method Complete() of TransactionScope scope was not complete. But actually three labels are showing new values. label1.Text="1";
3
7721
by: kikapu | last post by:
Hi to all folks, i am trying to understand the use of System.Transactions in general and TransactionScope particularly. What am i allowed to do in a using statement that wraps a TransactionScope object, so this to be rollback in case of an exception or when i do not call scope.complete ?? I mean, can i set an object's variables and then un-done these sets
3
3108
by: BLUE | last post by:
Only SQL Server 2005 or also DB2, Oracle and MySQL? Thanks, Luigi.
0
1439
by: RP | last post by:
I have a two classes, first named "ModCon" has procedures written for connections and the second named "ModRes" contains functions and procedures that can be reused. For my question it is important to add sample codes of the two classes and later the code from a Form's button click event which is giving problem. ======================================== public string ConString; public SqlConnection myCN = new SqlConnection();
3
8026
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)) { TableAdapter1.InsertQuery(id, name); TableAdapter2.InsertQuery(id, customerName, customerAddress); transScope.Complete(); }
2
2635
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 great. But now, I need to stretch the transaction across to sql databases using two different connections i.e. using (TransactionScope scope = new TransactionScope) {
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9338
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4712
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.