Sam,
As far as a single database is considered, the only difference between a
ADO.NET 2.0 System.Transactions based transaction and a regular
SqlTransaction is "Isolation level". It is a big difference however.
Sql2000 will default the isolation level to serializable (performance pig),
even if there is one single RM (One database) involved in the transaction.
Sql2k5 however will PROMOTE the transaction from LTM (Lightweight
transaction manager) to MSDTC --- AUTOMATICALLY for you .. thus changing
the isolation level ONLY IF it needs to
.
Now, to answer your specific question. System.Transactions is NOT a
replacement for SqlTransaction. For single database transactions in MOST
cases you still want to use SqlTransaction. But can System.Transactions BE
used in a single database scenario??? YES SURE they can be. The differences
are -
a) You donot explicitly enroll in the transaction - so you don;'t know you
are in a transaction or not - atleast you don't control it explicitly.
b) You don't control when your isolation level got escalated - bad bad.
c) It's an overkill
To make the long story short -
Yes you can use System.Transactions for single db transactions.
And NO you shouldn't (in most cases) use System.Transactions for single
database transactions.
Hope this helps?
BTW here is a relevant blog post I wrote long back that you might wanna
read -
http://www.codebetter.com/blogs/sahil.malik/archive/2004/12/09/35816.aspx
- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/