(The below is covered in further depth in my upcoming book - Chapter #11)
So in my last blog post, I explained why MSDTC is sucky. If you haven't read that yet, I suggest you read that first. But anyway, so what is LTM
LTM is the Lightweight Transaction Manager. Well in short it is the coolest invention since the wheel. Okay maybe fire was the coolest invention. Anyway, so for transactions that don't need the full hoopla MSDTC provides, it is kinda unfair that those transactions should pay the price of a full fledged transaction. So LTM is the transaction manager that takes care of your transaction - provided your RM meets certain criteria. If in case the RM no longer meets that criteria, the transaction will then automatically be handed over to MSDTC.
The super ultra duper cool thing is, this escalation to MSDTC occurs behind the scenes - when you are using the RM - you are blissfully ignore of what is going on. As a matter of fact, thanks to the fantastic DataWorks team, SqlConnection supports this concept - this concept is called PROMOTABLE ENLISTMENT. (ooh the name sounds heavy duty doesn't it)
So what is the criteria for an RM to work under LTM It is almost easier to say what will get moved from LTM to MSDTC. So the escalation to MSDTC will happen if -
a) A durable RM shows up that doesn't support single phase notifications (another big name - hopefully I'll blog about it one day in the near future).
b) Two durable RMs show up in the same transaction.
c) The transaction spreads over multiple appdomains.
Again, the hella cool thing is - say when you are using SqlConnection, this escalation will happen behind the scenes, and you will remain blissfully ignorant. And say if you were writing an RM where performance was hella important - then you've gotta know how to create a promotable single phase enlistment - otherwise don't worry.
*WHEW*, so tonight, in the last 1/2 hour I quickly wrote up a good introduction to "Distributed Transactions in .NET 2.0". Trust me, there is tonnes more to say, but not blogging about it != don't wanna tell. Whenever I get time in the future, I will vomit more details. But for now, here is a quick TOC -
TOC
100: System.Transactions - and why should you care to know about it.
100: Important Players in Distributed TransactionsRMs and DTCs
100: Two phase commits - and distributed transactions
100: So Sahil, why does MSDTC suck
200: What is LTM: Lightweight Transaction Manager, and how does that help
Poor Sahil tired typing so much .. Until later .. adios folks :-)