index > Transactions Programming > DTC bails after ~600s - Can anyone reproduce this problem?

DTC bails after ~600s - Can anyone reproduce this problem?


I'm observing a problem where the DTC bails after ~600s, create a console application and run this against SQL2000...

using System;

using System.Collections.Generic;

using System.Text;

using System.Transactions;

using System.Data.SqlClient;

namespace ConsoleApplicationTXtimeout

{

class Program

{

static void Main(string[] args)

{

TransactionOptions transactionOptions = new TransactionOptions();

transactionOptions.IsolationLevel = IsolationLevel.ReadCommitted;

//transactionOptions.Timeout = new TimeSpan(0,0,0,30);

transactionOptions.Timeout = new TimeSpan(0);

DateTime started = DateTime.Now;

using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required,transactionOptions))

{

while (DateTime.Now - started < new TimeSpan(0, 10, 0))

{

using (SqlConnection connection = new SqlConnection("Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=SSPI"))

{

connection.Open();

SqlCommand command = new SqlCommand("Update MyTable set MyField = MyField", connection);

command.ExecuteNonQuery();

Console.WriteLine(DateTime.Now);

System.Threading.Thread.Sleep(65000);

} // end connection

} // do 10 mins worth

transactionScope.Complete();

Console.WriteLine(DateTime.Now);

} // end Tx

Console.ReadLine();

}

}

}




http://pdkm.spaces.live.com/
pkr2000

You are hitting the MaximumTimeout - see my previous post at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=759488&SiteID=1




[http://blogs.msdn.com/florinlazar - Enjoy transactional programming with System.Transactions!]
Florin Lazar - MSFT
reply 2

You can use google to search for other answers

 

More Articles

• Regarding MS DTC Sample Application
• Lightweight transactions vs. Connection pooling
• Newbie question about removing the use of MSDTC
• COM transactions broken after performance tuning....HELP!
• Working with DTC(Urgent)
• Can we have more control over the transactions framework?
• MSDTC, distributed applications and XA compatability
• DTCGetTransactionManagerEx error
• Import\Enlist of MSDTC transaction failed
• promote a transaction to DTC
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

• UnauthorizedAccessException = Error acce
• .NET COM+ - "Error when enlisting i
• ServicedComponent + Postgres
• Entry point not defined
• Oracle 8.17 and TransactionScope
• transaction scope with oracle produces a
• TIP Txn resolution (*ONLY* failed to not
• Confused, what is the relation between M
• Windows 2003 Server SP1 MS DTC
• TransactionScope authentication / poorly
• Working with DTC(Urgent)
• Configuring MSDTC on Client PCs
• Lightweight transactions vs. Connection
• Missing Commit
• [SysTx] Why do two connections get promo

Hot Articles

• ServicedComponent shared Transaction
• MSDTC problems
• Problem with TransactionScope when runni
• Lightweight transactions vs. Connection
• UnauthorizedAccessException when using M
• [SysTx] Why do two connections get promo
• Missing Commit
• MSDTC error : Import of MSDTC transactio
• TransactionInDoubtException
• Architecture: System.Transactions vs Ent
• Confused, what is the relation between M
• Count number of active transactions in C
• Design pattern for enlisting a "pla
• Distributed transaction support in wcf u
• Need useful documentation/sample for usi

Recommend Articles

• Entry point not defined
• Error 0x8004D00E on SQL Server 2000 + Wi
• XADLL With Oracle
• Confused, what is the relation between M
• [SysTx] Why do two connections get promo
• Tiny question about MSDTC behaviour
• TransactionScope with sql and msmq
• TransactionInDoubtException
• Transaction Scope Problem
• MSDTC, distributed applications and XA c
• Windows 2003 Server SP1 MS DTC
• Design pattern for enlisting a "pla
• promote a transaction to DTC
• Missing Commit
• How to detect when a Compensating Resour