Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2007

Tip: Looking for answers? Try searching our database.

Killing a process while in a TransactionScope

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gareththackeray@gmail.com - 03 Apr 2007 15:26 GMT
Hi,

We've been using the TransactionScope class which is great and really
makes using Transactions a doddle.  However, if we kill the process in
the middle of a using(TransactionScope) block, it leaves it hanging,
seemingly indefinitely, until we restart the DTC on either client or
server.

So, I have two questions:

1. are there any techniques to force the transaction to rollback on
killing the process;

2. which of the many available timeouts controls the transaction
timeout on the DTC?

Thanks in advance,

Gareth
Laura T. - 03 Apr 2007 16:29 GMT
What you mean by "killing", TerminateProcess() API?
If so, there is nothing you can do about it. TerminateProcess() "freezes"
the target process immediatly. No more user mode code will run on it. No
cleanup. Nothing.

This works for me. Never seen pending transactions around for more than 35
seconds.
using (TransactionScope innerTrx = new
TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(30)))
{
}

It is possible to set a global timeout for MSDTC (old doc but actual):

http://support.microsoft.com/?scid=kb%3Ben-us%3B287499&x=12&y=13

> Hi,
>
[quoted text clipped - 15 lines]
>
> Gareth
Laura T. - 03 Apr 2007 16:32 GMT
"2. which of the many available timeouts controls the transaction timeout on
the DTC?"
I think it is this:
http://msdn2.microsoft.com/en-us/library/system.transactions.transactionmanager.
maximumtimeout.aspx


> What you mean by "killing", TerminateProcess() API?
> If so, there is nothing you can do about it. TerminateProcess() "freezes"
[quoted text clipped - 32 lines]
>>
>> Gareth
gareththackeray@gmail.com - 04 Apr 2007 10:32 GMT
Thanks Laura.  We're seeing timeouts on transactions taking more than
20s though, which seems strange as we can't find any timeout set to
20s!  We'll keep looking...  In truth our database needs some tuning
so we should be able to reach the point of not getting 20s
transactions anyway.

Cheers,

Gareth

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.