473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Wich DBMS supports TransactionScope and distributed transactions?

Only SQL Server 2005 or also DB2, Oracle and MySQL?
Thanks,
Luigi.

Jun 7 '07 #1
3 3091
Luigi,

I imagine all of them do. While the underlying resource has to have the
ability to perform transactions (or it usually does, to help), it is the
provider for the databases which has to be aware of the current transaction
on the thread and react accordingly. The classes in System.Data.SqlClient
are most definitely aware, as are the OleDb classes I assume.

Your best bet is to check the documentation for the provider, or even
better, just wire up an example and see if it works.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"BLUE" <bluewrote in message news:eI**************@TK2MSFTNGP02.phx.gbl...
Only SQL Server 2005 or also DB2, Oracle and MySQL?
Thanks,
Luigi.

Jun 7 '07 #2
If you [or somebody] did such an example, it might help to listen to:
System.Transactions.TransactionManager.Distributed TransactionStarted

Note that some providers (certainly SQL2005) use promotable
transactions, so it can use the LTM initially rather than DTC; this
means that the distributed-transaction is not started until the second
connection gets involved. This is easiest to demonstrate with
different connection strings (e.g. different database), which forces
DTC - but note that this area is *further* complicated (as if /that/
were necessary) by the presence of MARS... so the connection you've
snagged (possibly silently using enterprise library) might already be
busy in the same scope, but you get to share.

[note: I know from previous posts that the OP is aware of this; this
is more for the benefit of the archive...]

Marc

Jun 8 '07 #3
So far googling and googling I've found that except for SQL Server provider,
it is not sure if the others support Transaction scope + DTC:
- MySQL it was a feature they want to develop but now they don't tell
- Oracle changelog states it supports, but users does not agree
- DB2 seems to support

http://www.bytefx.com/blog/CategoryV...ory,MySQL.aspx

http://www.oracle.com/technology/tec...wfeatures.html
http://www.oracle.com/technology/doc...0.2_readme.txt
http://forums.oracle.com/forums/thre...hreadID=379962

http://www.ibm.com/developerworks/fo...m=467#13785120
I think all supports TransactionScope without DTC so the problem is the
following.

I'm doing a select on Table1 and then I have a loop on the datareader: for
each record I do many queryies to preform insert or update on 4 other tables
(some selects are involved of course).

Table1 is used only to insert records (each application insert a new record
so each concurrent access does not affect the others as if there was no
concurrency).

From time to time I need to update the 4 other tables with data from Table1
where Date < X (X = Now) and after insertion I'll delete the inserted
records.

I've thought I can do the select outside the TransactionScope, but:

- if I loop on the datareader inside the transactionscope, a distributed
transaction occurs?

- when I have to delete inserted records I cannot do DELETE FROM Table1
WHERE Date < X since between te select and the entering in the transaction
scope, a concurrent access could have inserted a row that matches the where
clause.
I have to do a "DELETE INSERTED ROW" instead of a global delete right?
Thanks a lot,
Luigi.
Jun 8 '07 #4

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

Similar topics

4
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...
3
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...
5
by: RP | last post by:
I tried following code but it generates error at line (using .....): Error 23 The type or namespace name 'TransactionScope' could not be found (are you missing a using directive or an...
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...
3
by: Michael Schöller | last post by:
Hello, First of all english is not my natural language so please fogive me some bad mistakes in gramatic and use of some vocables :). I have a great problem here. Well I will not use it...
0
by: Svein Terje Gaup | last post by:
Hi, I have some code on .NET 2.0 that creates a TransactionScope and then tries to open a SQL Connection. When I try to open the connection, I get this error: Test method...
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...
2
by: G.S. | last post by:
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
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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
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...

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.