<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Florin Lazar - Consistency Checkpoint : Programming</title><link>http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx</link><description>Tags: Programming</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Phase0 in .Net System.Transactions</title><link>http://blogs.msdn.com/florinlazar/archive/2006/04/09/phase0-in-net-system-transactions.aspx</link><pubDate>Sun, 09 Apr 2006 23:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:572035</guid><dc:creator>florinlazar</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/572035.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=572035</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=572035</wfw:comment><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;In a previous post (&lt;A href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx" mce_href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx"&gt;http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx&lt;/A&gt;) I talked about Phase0 and some useful things it allows you to do. Although not referred as Phase0, phase 0 features are available in .Net System.Transactions in two forms. Actually in three, but the third is a derivate. I will make many references here to the &lt;A href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx" mce_href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx"&gt;previous post &lt;/A&gt;on Phase0 and thus I recommend reading it first.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The first form where Phase 0 shows up is&amp;nbsp;through &lt;STRONG&gt;EnlistmentOptions.EnlistDuringPrepareRequired&lt;/STRONG&gt; that you can pass to EnlistVolatile or EnlistDurable methods. This allows you to create new enlistments during Prepare phase (and after Commit was called) and thus it allows you to create the caching resource manager (RM) discussed in the &lt;A href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx" mce_href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx"&gt;earlier post&lt;/A&gt;. To create a cache RM, you will first call EnlistVolatile with EnlistmentOptions.EnlistDuringPrepareRequired, and then, during Prepare you will connect to the database to write the updates. The connection to the database will usually call EnlistDurable on the transaction. Similar to Phase0 in the native DTC API, during the Prepare phase, one can enlist again passing EnlistmentOptions.EnlistDuringPrepareRequired which will issue another round of Prepare on that enlistment and so on.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The second form comes with &lt;STRONG&gt;DependentTransaction&lt;/STRONG&gt;. You get a DependentTransaction by calling the DependentClone method on a transaction object. You can get the other two scenarios enabled by Phase0, “early commit protection” and “async programming” by tweaking the DependentCloneOption to RollbackIfNotComplete and BlockCommitUntilComplete respectively. Then, you signal&amp;nbsp;that the work is done&amp;nbsp;by calling the Complete method of this dependent transaction.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Thus you will write the &lt;A href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx" mce_href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx"&gt;DoTransfer&lt;/A&gt; method in .Net as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;int DoTransfer(int amount, Transaction tx)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create the dependent clone&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DependentTransaction dtx = tx.DependentClone(DependentCloneOption. &lt;STRONG&gt;RollbackIfNotComplete&lt;/STRONG&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;DB1.OpenConnection(tx);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.OpenConnection(tx);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.DoCredit(amount);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // signal work complete on the “phase0” enlistment&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtx.Complete();&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;If the DependentTransaction is not Complete-ed before a Commit is issued by the client, the transaction will be aborted.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The “third” derivate form is &lt;STRONG&gt;TransactionScope&lt;/STRONG&gt; itself. TransactionScope protects you against early commits by automatically handling under the covers a DependentTransaction with RollbackIfNotComplete. That is why TransactionScope is recommended for most of the transactions scenarios. Given this you can write with the same confidence the DoTransfer method as follows:&lt;BR&gt;&lt;BR&gt;&lt;FONT face=Verdana color=#0000ff&gt;int DoTransfer(int amount, Transaction tx)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // creating a TransactionScope by passing in the received transaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this will set tx to be the ambient transaction and&amp;nbsp;create a&amp;nbsp;"rollback" dependent transaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;using(TransactionScope ts = new TransactionScope(tx))&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB1.OpenConnection(); // note that now OpenConnection is picking the transaction from the ambient context instead of passing it as a parameter&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.OpenConnection();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.DoCredit(amount);&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;FONT face=Verdana color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Complete();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Other Scenarios enabled and/or made easier by DependentTransaction&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;The “Worker Threads Scenario”&lt;/STRONG&gt;&lt;BR&gt;This is explained both at &lt;/FONT&gt;&lt;A href="http://pluralsight.com/blogs/jimjohn/archive/2005/05/01/7923.aspx" mce_href="http://pluralsight.com/blogs/jimjohn/archive/2005/05/01/7923.aspx"&gt;&lt;FONT face=Tahoma size=2&gt;http://pluralsight.com/blogs/jimjohn/archive/2005/05/01/7923.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma size=2&gt; and &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-US/library/ms229976(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-US/library/ms229976(VS.80).aspx"&gt;&lt;FONT face=Tahoma size=2&gt;http://msdn2.microsoft.com/en-US/library/ms229976(VS.80).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;Passing transaction ownership in a sequence of threads&lt;BR&gt;&lt;/STRONG&gt;Described at &lt;/FONT&gt;&lt;A href="http://pluralsight.com/blogs/jimjohn/archive/2006/01/01/17769.aspx" mce_href="http://pluralsight.com/blogs/jimjohn/archive/2006/01/01/17769.aspx"&gt;&lt;FONT face=Tahoma size=2&gt;http://pluralsight.com/blogs/jimjohn/archive/2006/01/01/17769.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma size=2&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;Async Programming&lt;BR&gt;&lt;/STRONG&gt;This is the scenario described in &lt;A href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx" mce_href="http://blogs.msdn.com/florinlazar/archive/2006/01/29/518956.aspx"&gt;my previous post&lt;/A&gt; where the client asks asynchronously a service to do some work as part of the transaction, but doesn’t want/need to wait until the service completes the work. The code will look like the following in .Net:&lt;BR&gt;&lt;BR&gt;Client Code&lt;BR&gt;&lt;FONT face=Verdana color=#0000ff&gt;void MainFunction()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using(TransactionScope ts = new TransactionScope())&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // dtx is a member of the current class of type DependentTransaction&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // its lifetime needs to be at least until the ack from the service is received&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.dtx = Transaction.Current.DependentClone(DependentCloneOption.&lt;STRONG&gt;BlockCommitUntilComplete&lt;/STRONG&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AsyncDoTransfer(tx, AckFromDoTransfer);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Complete();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;void AckFromDoTransfer()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.dtx.Complete();&lt;BR&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Server Code&lt;BR&gt;&lt;FONT face=Verdana color=#0000ff&gt;void AsyncDoTransfer(tx, AckFromDoTransfer)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DependentTransaction dtx = tx.DependentClone(DependentCloneOption. &lt;STRONG&gt;BlockCommitUntilComplete&lt;/STRONG&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AckFromDoTransfer(); // the client can Commit safely from now on since I have dtx created on the service side&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the dependent clone auto-created by TransactionScope doesn’t help in this scenario because it rollbacks on early commit while we need a blocking clone&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using(TransactionScope ts = new TransactionScope(tx))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // doing the work that takes a lot of time&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB1.OpenConnection();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.OpenConnection();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.DoCredit(amount);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Complete();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// work if finished on the service so we can safely let the transaction continue&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dtx.Complete();&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=572035" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/MSDTC/default.aspx">MSDTC</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/phase0/default.aspx">phase0</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/DependentTransaction/default.aspx">DependentTransaction</category></item><item><title>Our Own Forum is Now Live! Please Join Us at the &amp;quot;Transactions Programming Forum&amp;quot;</title><link>http://blogs.msdn.com/florinlazar/archive/2006/03/10/our-own-forum-is-now-live-please-join-us-at-the-quot-transactions-programming-forum-quot.aspx</link><pubDate>Sat, 11 Mar 2006 02:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:549107</guid><dc:creator>florinlazar</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/549107.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=549107</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=549107</wfw:comment><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;I'm really happy to announce that our own forum, dedicated to transactions in Windows and .Net is now live at &lt;/FONT&gt;&lt;A href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=388&amp;amp;SiteID=1"&gt;&lt;FONT face=Tahoma size=2&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=388&amp;amp;SiteID=1&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The RSS feed for the forum is &lt;/FONT&gt;&lt;A href="http://forums.microsoft.com/MSDN/rss.aspx?ForumID=388&amp;amp;Mode=0&amp;amp;SiteID=1"&gt;&lt;FONT face=Tahoma size=2&gt;http://forums.microsoft.com/MSDN/rss.aspx?ForumID=388&amp;amp;Mode=0&amp;amp;SiteID=1&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;I hope that by having a forum that is dedicated to Transactions technologies we can build a better channel for our customers to get quick and accurate answers to their questions. We encourage everyone in the community to participate in this forum.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;I look forward to us working together to make this forum a valuable resource for Transactions discussions.&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=549107" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/MSDTC/default.aspx">MSDTC</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Enterprise+Services/default.aspx">Enterprise Services</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Indigo/default.aspx">Indigo</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/forum/default.aspx">forum</category></item><item><title>MSDTC: The Magic of Phase Zero (Phase0) – Or – When Using 2PC Transactions Is Not Enough</title><link>http://blogs.msdn.com/florinlazar/archive/2006/01/29/msdtc-the-magic-of-phase-zero-phase0-or-when-using-2pc-transactions-is-not-enough.aspx</link><pubDate>Mon, 30 Jan 2006 01:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:518956</guid><dc:creator>florinlazar</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/518956.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=518956</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=518956</wfw:comment><description>&lt;P&gt;The most known technique of implementing distributed transaction is the "two-phase commit" (2PC).&amp;nbsp;Here is a quick summary of how this technique works:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Active phase: After the transaction is created and before the "commit" message is issued by the creator, the transaction is in the "active" state. During this phase, resource managers can "enlist" and become part of the transaction. When "commit" is issued, the transaction moves to Phase1.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Phase1 (preparing phase): in which the superior transaction manager (TM), after receiving the Commit message from the creator of the transaction, "asks" the enlisted resource managers or the subordinate transaction managers to "prepare" for commit; if all respond with a successful "prepared" answer then the transaction moves to Phase 2, otherwise the transaction is aborted&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Phase 2 (committing phase) the superior TM writes a durable log entry about the status of the transaction and then starts sending "commit" messages to all the resource managers and subordinate TMs part of the transaction. In the case of any type of error (communication, computer crash etc), the superior TM will continue to send the "commit" messages until a successful "committed" message is received from all the participants. When all the participants responded "committed", the log entry corresponding to the current transaction is removed from the log and the transaction ends.&lt;/P&gt;
&lt;P&gt;In addition to the "two-phase commit" technique, MSDTC supports another phase called &lt;STRONG&gt;Phase Zero (Phase0)&lt;/STRONG&gt; which occurs after the creator of the transaction calls Commit and before Phase1 starts. To participate in Phase0 you need to enlist as a Phase0 participant: &lt;A href="http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/transactionphase0enlistment_6j04.asp?frame=true" mce_href="http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/transactionphase0enlistment_6j04.asp?frame=true"&gt;http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/transactionphase0enlistment_6j04.asp?frame=true&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/pgdtc_dev_8ldf.asp?frame=true" mce_href="http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/pgdtc_dev_8ldf.asp?frame=true"&gt;http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/pgdtc_dev_8ldf.asp?frame=true&lt;/A&gt;. MSDTC will always start with Phase0 and remain there until all the Phase0 participants responded. &lt;/P&gt;
&lt;P&gt;The great benefit of Phase0 is that during this phase, any type of enlistment (including Phase0) in the transaction it is still allowed. Once the transaction moves to Phase1, the new enlistments will be denied. Since you can create a new Phase0 enlistment during Phase0, MSDTC executes this phase in waves. After "commit" is issued, the TM will first send "Phase0Request" messages (&lt;A href="http://msdn.microsoft.com/library/en-us/cossdk/htm/itransactionphase0notifyasync_8ywk.asp" mce_href="http://msdn.microsoft.com/library/en-us/cossdk/htm/itransactionphase0notifyasync_8ywk.asp"&gt;http://msdn.microsoft.com/library/en-us/cossdk/htm/itransactionphase0notifyasync_8ywk.asp&lt;/A&gt;) to all known Phase0 enlistments. If all of them successfully replied Phase0Done (&lt;A href="http://msdn.microsoft.com/library/en-us/cossdk/htm/itransactionphase0enlistmentasync_5pt1.asp" mce_href="http://msdn.microsoft.com/library/en-us/cossdk/htm/itransactionphase0enlistmentasync_5pt1.asp"&gt;http://msdn.microsoft.com/library/en-us/cossdk/htm/itransactionphase0enlistmentasync_5pt1.asp&lt;/A&gt;), the TM will look for new Phase0 enlistments that occurred meanwhile and it will start another Phase0 wave if any is found and so on. Phase0 will end when no other new Phase0 enlistment is found after a wave. After Phase0 ends, the transaction moves to Phase1.&lt;/P&gt;
&lt;P&gt;Phase0 allows the following three scenarios: caching resource managers, protection against "early" commits and "safe" propagation of transactions in async programming.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Caching Resource Managers&lt;/STRONG&gt;&lt;BR&gt;Using a Phase0 enlistment, a middle-tier component can delay the connection to the database(s) as long as possible, acting as a cache to the requests from the client and thus reducing network traffic and database locks. This works great for those scenarios in which the client does many changes to the same data before it finally decides to end and save the work. When the client "ends" the work, the transaction is committed, and the TM issues a Phase0Request to the caching component. Before replying Phase0Done, the component will open all the necessary connections to the databases that need to be involved and it will persist the final data. These databases will now be "durably" enlisted in the transaction. After Phase0Done is received, the TM will continue with the 2PC and commit the transaction. See also &lt;A href="http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/pgdtc_dev_0y2b.asp?frame=true" mce_href="http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/pgdtc_dev_0y2b.asp?frame=true"&gt;http://msdn.microsoft.com/library/?url=/library/en-us/cossdk/htm/pgdtc_dev_0y2b.asp?frame=true&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Protection Against "Early" Commits&lt;BR&gt;&lt;/STRONG&gt;In general, 2PC transactions help to ensure integrity of data during different types of system errors. Using Phase0 you can also protect from badly written software. &lt;/P&gt;
&lt;P&gt;Let me give an example: let's say a transaction is created on the client side and then propagated to a middle tier component that is asked to do work as part of that transaction. The work that this component needs to do involves two databases, DB1 and DB2, as follows:&lt;/P&gt;
&lt;P&gt;int DoTransfer(int amount, transaction tx)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;DB1.OpenConnection(tx);&lt;BR&gt;&amp;nbsp; DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp; DB2.OpenConnection(tx);&lt;BR&gt;&amp;nbsp; DB2.DoCredit(amount);&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;The component is using the received transaction to communicate with the two databases to ensure the integrity of its data. Both Debit and Credit operations need to be successful or none should occur. This looks great until now. But what if the client doesn't wait for DoTransfer to finish and calls Commit right after the DB1.DoDebit returned and before DB2.OpenConnection started? A badly written client can do that, maybe the programmer wanted to use multi-threading but didn't quite get it right. What will happen is that the component is left with inconsistent data in the databases, a debit operation that occurred without a credit operation. There is nothing wrong with the transaction itself; from the point of view of the 2PC transaction, only one enlistment occurred and that one responded successfully to both "prepare" and "commit" phases. It is the application logic that is wrong here. &lt;/P&gt;
&lt;P&gt;Can you protect against this type of situation? Yes, you can. One way is to write bug-free code, but mistakes happen. If you don't own the client code, the problem is even harder. The best solution is to use a Phase0 enlistment and modify the middle tier code as follows:&lt;/P&gt;
&lt;P&gt;int DoTransfer(int amount, transaction tx)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;EnlistPhase0(tx); //Creates a Phase0 enlistment with the transactions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;DB1.OpenConnection(tx);&lt;BR&gt;&amp;nbsp;DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp;DB2.OpenConnection(tx);&lt;BR&gt;&amp;nbsp;DB2.DoCredit(amount);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;SignalWorkCompletedToPhase0Enlistment(tx); // signals the Phase0 enlistment that the work was completed&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;Your Phase0 enlistment should start with a "WorkCompleted" flag set to false. The method SignalWorkCompletedToPhase0Enlistment mentioned above will set this flag to true. If a Phase0Request is received and the flag is still false, it means that the Commit was issued before the DoTransfer finished its work. At this point, you have two options: &lt;BR&gt;- one option (the recommended one when "early commits are not expected) is to abort the transaction and log some error; if you own the client code you might want to catch and fix these "early" commits&lt;BR&gt;- the other option is to hold the Phase0Request, received while DoTransfer is still doing work, until the flag becomes true and only then let the transaction continue by replying with Phase0Done; use this option when you expect to receive "early" commits as part of your system logic and flow.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Asynchronous Programming&lt;/STRONG&gt;&lt;BR&gt;This is very similar to the early commits scenarios mentioned above, but this time, the early commits are "by design". One can encounter scenarios where a piece of the application starts a transaction and delegates the work asynchronously to other parts of the application (a different thread of execution, a remote location) and without waiting for a response continues with committing the transaction. In these scenarios, we will choose the second option from above, the one that blocks the commit until work is finished. The code is similar:&lt;BR&gt;&amp;nbsp;Client code:&lt;BR&gt;&amp;nbsp;&amp;nbsp;Transaction tx = StartTransaction();&lt;BR&gt;&amp;nbsp;&amp;nbsp;AsyncDoTransfer(tx); // like create a separate thread and let it do the transfer operation etc&lt;BR&gt;&amp;nbsp;&amp;nbsp;SomeOtherAsyncWork(tx);&lt;BR&gt;&amp;nbsp;&amp;nbsp;CommitTransaction(tx);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Server code:&lt;BR&gt;&amp;nbsp;&amp;nbsp;// inside AsyncDoTransfer that receives the transaction from the client&lt;BR&gt;&amp;nbsp;&amp;nbsp;EnlistPhase0AndBlock(tx); // if we get a Phase0Request we will block and wait until SignalWorkCompletedToPhase0Enlistment is called and only then reply with Phase0Done&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp; DB1.OpenConnection(tx);&lt;BR&gt;&amp;nbsp; DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp; DB2.OpenConnection(tx);&lt;BR&gt;&amp;nbsp; DB2.DoCredit(amount);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SignalWorkCompletedToPhase0Enlistment(tx); // signals the Phase0 enlistment that the work was completed&lt;BR&gt;&amp;nbsp;&amp;nbsp;return;&lt;/P&gt;
&lt;P&gt;Looks nice and safe... Well, there is a problem even with this code. What if, Commit is called even before we are able to enlist in Phase0 in the AsyncDoTransfer method? We can end up again with some inconsistent data. The solution is to create some sort of acknowledgment from the server to the client saying that at least it got to the phase0 enlistment: "hey client, I know I'm slow and I will do your requested work later but here is my ack that you can Commit your transaction safely any time from now on". To accomplish this we will have to use phase0 enlistments on both the client and server side as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Client Code:&lt;BR&gt;&amp;nbsp;&amp;nbsp;Void MainFunction()&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transaction tx = StartTransaction();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnlistPhase0AndBlock(tx); // if we get a Phase0Request we will block and wait until SignalWorkCompletedToPhase0Enlistment is called and only then reply with Phase0Done&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AsyncDoTransfer(tx, AckFromDoTransfer); // like sending an async message to a server and let it do the transfer operation etc&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CommitTransaction(tx);&amp;nbsp;&lt;BR&gt;&amp;nbsp; }&amp;nbsp; &lt;BR&gt;&amp;nbsp; void AckFromDoTransfer()&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SignalWorkCompletedToPhase0Enlistment(tx); // signals the Phase0 enlistment that the work was completed&amp;nbsp;&lt;BR&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Server Code:&lt;BR&gt;&amp;nbsp;&amp;nbsp;void AsyncDoTransfer(tx, AckFromDoTransfer)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;EnlistPhase0AndBlock(tx); // if we get a Phase0Request we will block and wait until SignalWorkCompletedToPhase0Enlistment is called and only then reply with Phase0Done&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AckFromDoTransfer(); // the client can Commit safely the transaction from now, since I'm protected by phase 0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // doing the work that takes a lot of time&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB1.OpenConnection(tx);&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DB1.DoDebit(amount);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.OpenConnection(tx);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DB2.DoCredit(amount);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SignalWorkCompletedToPhase0Enlistment(tx); // signals the Phase0 enlistment that the work was completed&lt;BR&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;The phase0 enlistment on the client side will make sure that we keep the transaction in phase0 until we get all the acks from our servers. Look at this as a method to pass phase0 "ownership" from client to servers. &lt;/P&gt;
&lt;P&gt;All these work due to the "magic" of phase0 that allows "infinite" number of enlistments, until no new phase0 enlistments are being created and the existing ones replied with a successful Phase0Done. I compare the Phase0 enlistment to the AddRef method from the good old COM lifetime management. A Phase0 enlistment will call "AddRef" on the "active phase" of the transaction, while a Phase0Done will call "Release" on the counter. While the counter is higher than zero, the transaction will not be allowed to enter Phase1.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=518956" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/MSDTC/default.aspx">MSDTC</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/phase0/default.aspx">phase0</category></item><item><title>Why and When to use transactions?</title><link>http://blogs.msdn.com/florinlazar/archive/2005/10/04/476775.aspx</link><pubDate>Tue, 04 Oct 2005 11:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:476775</guid><dc:creator>florinlazar</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/476775.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=476775</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=476775</wfw:comment><description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Many people ask - do I need transactions? Why do I need them? When to use them?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The answer is simple: use them all the time, unless you have a very good reason not to (for instance, don't use atomic transactions for "long running activities" between businesses). The default should always be yes. You are in doubt? - use transactions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Why are transactions beneficial? They help you deal with crashes, failures, data consistency, error handling, they help you &lt;a href="http://blogs.msdn.com/florinlazar/archive/2005/04/16/408837.aspx"&gt;write simpler code&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt; etc. And the list of benefits will continue to grow with time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Don't think in terms of transactions only when you talk to two or more databases. Starting with technologies like &lt;a href="http://blogs.msdn.com/florinlazar/archive/2005/05/12/416805.aspx"&gt;LTM&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt;, transactions are made available to be used for any multi-action operation. "X = A+B; Y = C*D;" can be transactional or atomic, as some prefer to name it, and can be seen as a single unit of work. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;That is also why support for transactions is available almost everywhere. In database systems, in COM+, in ASP.NET, in .Net Framework with System.Transactions and EntepriseServices, in Indigo, in Biztalk etc&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;You might be saying now: "but my friend X doesn't use transactions - why it is important that I use them?". It is mostly a problem on the education side. The industry didn't talk a lot about transactions and their usage until recently. The original scope of transactions was limited to database scenarios. But technologies around transactions evolved and continue to evolve, in terms on capabilities, ease of use, flexibility, performance etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;We used to talk about composable objects (as in OOP). We currently talk a lot about &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/html/wsoverview.asp"&gt;composable web services&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt; (as in SOA). The technologies are already here to start talking about composable atomic units of work.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;How about the future? One avenue is STM or "software transactional memory". Maybe another one is transactional support at hardware level.&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=476775" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Enterprise+Services/default.aspx">Enterprise Services</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Indigo/default.aspx">Indigo</category></item><item><title>Transactions Sessions at PDC 2005</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/14/transactions-sessions-at-pdc-2005.aspx</link><pubDate>Wed, 14 Sep 2005 20:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:466237</guid><dc:creator>florinlazar</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/466237.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=466237</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=466237</wfw:comment><description>&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma size=2&gt;If you are at PDC this year, don't forget to attend the sessions related to transactions. An easy way to find these sessions is to go to &lt;/FONT&gt;&lt;A href="http://commnet1.microsoftpdc.com/content/sessions.aspx"&gt;&lt;FONT face=Tahoma size=2&gt;http://commnet1.microsoftpdc.com/content/sessions.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma&gt;&lt;FONT size=2&gt; and search by Keyword="transaction".&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Tahoma size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma&gt;&lt;FONT size=2&gt;I especially recommend the session called "FUN320 - Windows &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:place w:st="on"&gt;Vista&lt;/st1:place&gt; &amp;amp; "Longhorn" Server: Improving Reliability Using System.Transactions and the Transactional NTFS and Registry".&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Jim Johnson, our architect for transactions is presenting this session together with Dana Groff, the program manager in Core File Services focusing on transaction technologies.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Tahoma size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma&gt;&lt;FONT size=2&gt;Here is the full list:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Tahoma size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;FUN320&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Windows &lt;st1:place w:st="on"&gt;Vista&lt;/st1:place&gt; &amp;amp; "Longhorn" Server: Improving Reliability Using System.Transactions and the Transactional NTFS and Registry &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Day/Time: Thursday, September 15 5:15 PM- 6:30 PM Room: 406 AB&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Speaker(s): Dana Groff, Jim Johnson&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Type(s): Breakout&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Level(s): 300&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Track(s): Fundamentals&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;You can build significantly more reliable applications by using the expanded and enhanced classes in the System.Transactions namespace. This session covers how to use new transaction-oriented programming techniques for application stability and robustness. Learn about the new systems in Windows Vista and "Longhorn" Server for supporting Transacted Files (TxF) and Transacted Registry (TxR) operations in both native and managed code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;FUN323&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Microsoft Research: Future Possibilities in Concurrency &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Day/Time: Friday, September 16 8:30 AM- 9:45 AM Room: 406 AB&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Speaker(s): Tim Harris&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Type(s): Breakout&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Level(s): 300&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Track(s): Fundamentals&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Learn about the investment Microsoft Research is making in future languages and tools to help write software that will gain the maximum benefit from tomorrow's multi-processor/multi-core hardware. In this session, we start by introducing some of the tools and techniques we've developed for tracking down and preventing bugs in multi-threaded software. We then turn to the language features that we're prototyping in research: our work on transactional memory is developing a programming model where data can be shared directly between threads without needing to worry about locking or low-level deadlocks; our work on synchronization is leading to a unified abstraction for co-ordination between threads and between processes. We'll demo some of our prototype systems, showing how these techniques can lead to software which is not only easier to develop, but which can scale from uniprocessors up to highly parallel systems.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Distributed Atomic Transactions - Wishful Thinking? &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Day/Time: Tuesday, September 13 9:00 PM- 10:00 PM Room: 511 C&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Type(s): Birds of a Feather&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Level(s): 300&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Web Services, via SOAP, is the preferred choice of doing wide-reaching distributed communications today. However, one of the few factors that has hindered its adoption in the enterprise today is its lack of ability to handle transactions between remote un-trusted (independent) boundaries. There are two schools of thought today with regards to transactions --- The Atomic Way or The Compensating Way which pretty much takes out the atomicity of ACID. Indigo supports WS-AT via Microsoft DTC. Will this be widely adopted in the enterprise collaboration space? Or are we living in Fool's Paradise? &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;COM307&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Windows Communications Foundation ("Indigo"): Writing Reliable and Transacted Distributed Applications &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Day/Time: Wednesday, September 14 3:15 PM- 4:30 PM Room: 403 AB&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Speaker(s): Shy Cohen&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Type(s): Breakout&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Level(s): 300&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Track(s): Communications&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;What do you do when your network connection breaks half-way through a request? How do you synchronize state changes across different Web services? How do you overcome a system crash without losing important messages? Windows Communications Foundation (formerly codename "Indigo") provides simple and powerful reliability mechanisms that allow you to easily address these types of network and application issues. Take an in-depth look at reliable sessions, queues, and distributed transactions, and how these technologies are used to achieve reliable, transacted communication. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;COM202&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Windows Communications Foundation ("Indigo"): A Lap around the Windows Communications Foundation &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Day/Time: Tuesday, September 13 1:00 PM- 2:15 PM Room: Halls C &amp;amp; D (Petree Hall)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Speaker(s): Omri Gazitt&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Type(s): Breakout&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Session Level(s): 200&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Track(s): Communications&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;Windows Communications Foundation (formerly codename "Indigo") is Microsoft's new platform technology for building distributed applications, bringing the best of ASP.NET Web services, .NET Remoting, Enterprise Services, WSE, and System.Messaging into one unified framework. This session introduces the core concepts in the Windows Communications Foundation programming model-addresses, bindings, contracts, and behaviors-and presents the Windows Communications Foundation feature set through the lens of these concepts. This session covers security, reliable messaging, transactions, queues, hosting, transports, interop/integration, and more. If you have never seen an introduction to Windows Communication Framework, this session is for you.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=1&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Tahoma size=2&gt;The slides from these sessions are currently available at &lt;/FONT&gt;&lt;A href="http://commnet.microsoftpdc.com/content/downloads.aspx"&gt;&lt;FONT face=Tahoma size=2&gt;http://commnet.microsoftpdc.com/content/downloads.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=466237" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/MSDTC/default.aspx">MSDTC</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Enterprise+Services/default.aspx">Enterprise Services</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Indigo/default.aspx">Indigo</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/PDC/default.aspx">PDC</category></item><item><title>What do you want to know about transactions?</title><link>http://blogs.msdn.com/florinlazar/archive/2005/05/07/415406.aspx</link><pubDate>Sun, 08 May 2005 00:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:415406</guid><dc:creator>florinlazar</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/415406.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=415406</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=415406</wfw:comment><description>&lt;FONT face=Tahoma size=2&gt;Please don't hesitate to send me your suggestions or questions or topics you would like to be discussed in this blog. You can post a comment to this post or use &lt;/FONT&gt;&lt;a href="http://blogs.msdn.com/florinlazar/contact.aspx"&gt;&lt;FONT face=Tahoma size=2&gt;http://blogs.msdn.com/florinlazar/contact.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma size=2&gt; to let me know. I'll prioritize the list and cover as much as I can.&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=415406" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/MSDTC/default.aspx">MSDTC</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Enterprise+Services/default.aspx">Enterprise Services</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Microsoft+Windows/default.aspx">Microsoft Windows</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Indigo/default.aspx">Indigo</category></item><item><title>ADO.NET/System.Data blog</title><link>http://blogs.msdn.com/florinlazar/archive/2004/09/20/ado-net-system-data-blog.aspx</link><pubDate>Tue, 21 Sep 2004 01:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:232029</guid><dc:creator>florinlazar</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/232029.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=232029</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=232029</wfw:comment><description>&lt;P&gt;Today, in most of the cases, transactions (distributed or not) are used in combination with ADO.NET (System.Data). Angel Saenz-Badillos talks about ADO.NET and Whidbey in his blog at &lt;A href="http://blogs.msdn.com/angelsb/" mce_href="http://blogs.msdn.com/angelsb/"&gt;http://blogs.msdn.com/angelsb/&lt;/A&gt; Consequently he talks about our System.Transactions as well, so make sure to take a look there too.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Of course, my dream and my team's dream is to make transactions be used everywhere and anytime (not only in combination with ADO.NET) to ensure correctness and reliability in software. And System.Transactions is a really big step towards making this dream come true.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=232029" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Transactions/default.aspx">Transactions</category><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category></item><item><title>Developing software in a non-privileged environment </title><link>http://blogs.msdn.com/florinlazar/archive/2004/01/09/49300.aspx</link><pubDate>Sat, 10 Jan 2004 02:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:49300</guid><dc:creator>florinlazar</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/florinlazar/comments/49300.aspx</comments><wfw:commentRss>http://blogs.msdn.com/florinlazar/commentrss.aspx?PostID=49300</wfw:commentRss><wfw:comment>http://blogs.msdn.com/florinlazar/rsscomments.aspx?PostID=49300</wfw:comment><description>&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Georgia size=2&gt;You (i.e. your login account) don&amp;#8217;t have to be a member of local Administrators group to do your daily tasks on your computer, including developing software. It might take a while to get used to it, but with time it will be as normal as using the seat belt in your car. The benefit is not only in ensuring a more secure environment, but also the software you produce is more likely to be available for use in a non-privileged environment. The software should not require elevated privileges unless it really needs them. Here are some resources about developing software as a non-admin: &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/security/default.aspx?pull=/library/en-us/dv_vstechart/html/tchdevelopingsoftwareinvisualstudionetwithnon-administrativeprivileges.asp"&gt;&lt;FONT face=Georgia size=2&gt;Developing Software in Visual Studio .NET with Non-Administrative Privileges&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Georgia size=2&gt; and &lt;/FONT&gt;&lt;A href="http://www.develop.com/kbrown/book/html/howto_runasnonadmin.html"&gt;&lt;FONT face=Georgia size=2&gt;How to develop code as a non-admin&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;&lt;FONT face=Georgia&gt;.&lt;SPAN style="COLOR: black"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=49300" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/florinlazar/archive/tags/Programming/default.aspx">Programming</category></item></channel></rss>