Syndicate

News

My name's Marco De Sanctis and I'm an IT professional from Italy. This is my technical blog, about .NET and related application development and design technologies.

Download my Resume (.doc)

Recent Comments

7/28/2008 at 2:46 PM

Hi...What kind of problem are you experiencing?...
by Marco De Sanctis

Read more...

7/28/2008 at 12:59 PM

Very nice concept and can i expect for list box? ,...
by Sudhir Malireddy

Read more...

7/28/2008 at 9:58 AM

In aggregates the rula is: who is the rool element...
by Tommaso Caldarola

Read more...

7/22/2008 at 7:49 PM

Been there too in a past project! I remember this ...
by Mathias

Read more...

7/14/2008 at 11:50 PM

Sure I am... but if you got batches that last for ...
by Marco De Sanctis

Read more...

Recent Posts

Crunch mode is a pure waste of time, energy and money

7/31/2008 at 5:41 PM

Read more...

Double Click on the .sln file doesn't open Visual Studio on Vista

7/27/2008 at 9:02 AM

Read more...

Domain Model & Aggregates: when do master-detail associations happen?

7/22/2008 at 4:08 PM

Read more...

How I Got Started in Software Development

7/14/2008 at 12:16 AM

Read more...

Unleash the power of VisualStateManager with custom states

6/30/2008 at 12:12 AM

Read more...

TransactionScope timeout

posted on Saturday, June 14, 2008 12:01 AM | Filed Under [ Misc ]

TransactionScope constructor has an overload that lets you specify a transaction timeout:

image

The example above sets up a 1 hour timeout on the new transaction. I was using a similar approach to execute an Oracle stored procedure which was doing some batch processing that took about 30 mins. to complete. Anyway, I could se the transaction being rolled back after about 10 minutes, even though the OracleCommand itself had a proper timeout and no exception was raised by the underlying stored procedure.

Pretty strange, isn't it?

After some research, I've discovered that the TransactionManager class, which ultimately manages the transactions lifespan, has a readonly MaximumTimeout property, that can be set only at machine.config level and has a default value of 10 minute:

image

This is the maximum time limit your transaction can last, regardless of what you specify on the aforementioned constructor. In my case, I decided to move it to one hour limit.

Hopes this saves you a little time ;-)

kick it on DotNetKicks.com

Comments

Gravatar
# re: TransactionScope timeout
Posted by Gian Maria on 6/14/2008 4:14 PM
Yep, it happened to me too. It violates the principle of least surprise. if there is a maximum value it would be good if the class would not expose a timeout value, or it raise an exeption when the value used in the constructor is superior to that in machine config ;)

Alk.
Gravatar
# re: TransactionScope timeout
Posted by Keith G on 7/14/2008 10:12 PM
Are you concerned that changing the value changes the behavior for all programs that use TransactionScope?
Gravatar
# re: TransactionScope timeout
Posted by Marco De Sanctis on 7/14/2008 11:50 PM
Sure I am... but if you got batches that last for more than 10 mins, I don't think you have any other option.
Gravatar
# re: TransactionScope timeout
Posted by Mathias on 7/22/2008 7:49 PM
Been there too in a past project! I remember this wasn't a fun episode; we couldn't figure out what the issue was initially, and the only way to verify that the problem is fixed is to run a (pretty) long transaction. We got lots of fun 10-minutes stretches, anxiously waiting in front of the computer...
Gravatar
# Hot girls.
Posted by Hot high school girls. on 8/26/2008 7:02 AM
Squirting girls female ejaculation hot fountains. Hot girls masturbating. Hot nude girls.
Post Comment
Title *
Name *
Email
Url
Comment *  
Please add 2 and 4 and type the answer here: