Confused, what is the relation between MSDTC timeout and System.Transaction Option?

What I seem to be seeing is that when I create a System.Transaction with:

transactionOptions.Timeout =newTimeSpan(0)

but keep the COM+ Explorer MSDTC timeout at 60sec it timesout at 60secs. I don't have have Enterprise Services attribs on my code. What's happening or am I just going mad!?

[429 byte] By [pkr2000] at [2007-12-24]
# 1

Hey pkr2000,

There must be some action occurring that is causing transaction management escalation. System.Transactions timeout in the Options object is used by the System.Transactions Transaction Manager. This TM is local to the process. The MSDTC timeout of course applies to the MSDTC TM. When a transaction is promoted and management is escalated from the System.Transactions TM to the MSDTC TM you use the MSDTC timeout in addition to the System.Transactions timeout. Once management has been escalated the first of these two timespans to expire will cause transaction to timeout and abort. In this case you set the System.Transactions timeout to be infinite so the Transaction should always timeout at around 60 seconds from the event that caused escalation.

HTH,
Miguel

MiguelGasca-MSFT at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 2
Thanks Miguel, is that an educated guess or do you know that to be true? If it is true then at least it would explain what is going on although I'd be a little bit suprised by that behaviour. I'd always considered the COM+ Explorer settings to be a default value if you omit the timeout in System.Transaction rather than an alternative value. So I find it very odd that if I specify a timeout then it should be overriden by a default!
pkr2000 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 3

I've run a quick test application that requests an infinite timeout, does some work, sleeps for 65 secs and then commits. I've set my DTC timeout to 60secs and the code works fine. I can see the Tx in the DTC statistics come and go so I don't believe it takes the lesser of the two values. So I'm still dazed and confused!

pkr2000 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 4

The plot thickens. I've now spotted that the timeout occurs after 10 mins! Regardless of the number in the DTC timeout or the .net code. Where does 10 mins come from?

[Edit] One possible source is the SQL (2000) remote query timeout that's set to 600s. However, I've tried setting that to 0 (no timeout) and I still get the same 10 min rollback. I'm really puzzled by this since I've had a number of very long running Txs in the past. What's changed?

pkr2000 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 5

Pkr2000,

Sorry for the confusion. The 10 minute timeout comes from MaximumTimeout property for System.Transactions.

For reference see http://msdn2.microsoft.com/en-us/library/system.transactions.transactionmanager.maximumtimeout.aspx and http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=293621&SiteID=1

The setting from the COM+ Explorer should not influence your transaction started by System.Transactions. This setting is the default for COM+ transactions.

Cheers!

FlorinLazar-MSFT at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 6

You're a star thanks.

pkr2000 at 2007-10-8 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...

Software Development for Windows Vista

Site Classified