DCSIMG
WCF Transactions – Barebones Demo – Overview - David Sackstein's Blog

WCF Transactions – Barebones Demo – Overview

In the next four posts, we will be building a barebones project to demonstrate WCF’s support for Transactions.

The other posts in this series are:

WCF Transactions – Barebones Demo – Part 1 (Tools)

WCF Transactions – Barebones Demo – Part 2 (Service Code)

WCF Transactions – Barebones Demo – Part 3 (Client Code)

WCF Transactions – Barebones Demo – Part 4 (Analysis)

You can download the source code for the series from here.

The demo focuses on the usage of these properties:

  1. TransactionScopeRequired (of the OperationalBehavior attribute)
  2. TransactionFlow (of some of the Binding classes)
  3. TransactionFlowOption (of the TransactionFlow attribute)

Hopefully, this demo will get you up and running and you can then easily use it to test other properties and behaviors that are not shown.

To operate the demo, you will not be needing an SQL server or any other resource manager, because we will build one ourselves. (A resource manager is the name given to objects that can enlist in transactions to commit and rollback changes made to a resource).

For a more in depth discussion of Volatile Resource Managers and a guide to implementing transactional types I recommend reading Volatile Resource Managers in .NET Bring Transactions to the Common Type by Juval Lowy.

In the next post I will introduce the VolatileResourceManager which, is what’s its name suggests. It implements the IEnlistmentNotification interface. It is simpler and has less functionality than Transaction<T> described in Juval’s article. However, it is sufficient for our purposes. I said barebones, right ? : )

As we have the source code for the VolatileResourceManager, we can easily see the commits and rollbacks (or lack thereof) that are generated by transactional (or non-transactional) code that uses it.

We will also want to see whether a transaction in which the VolatileResourceManager participates is a local or distributed transaction, and whether the transaction flowed from the client or was created locally within the service. To assist with this, I also implement an extension function to the Transaction class that displays this information about a transaction.

So far, no WCF.

In the third and fourth posts in this series, I will implement the Service and Client code respectively. Also in the fourth post, we will write code to use the VolatileResourceManager in a transactional operation that rolls back. The code will do so once against a local implementation of the class and a second time across a WCF service boundary.

This is where we will be able to observe how transactions flow (or not) from a WCF client to a WCF service.

The fifth post runs the demo and discusses the results.

Published Sunday, June 14, 2009 4:15 PM by David Sackstein
תגים:,

Comments

# WCF Transactions – Barebones Demo - Part 1

Monday, June 15, 2009 12:15 AM by David Sackstein's Blog

In this post we will prepare two tools that will help us trace WCF’s transaction support in the demo

# WCF Transactions – Barebones Demo – Part 2

Monday, June 15, 2009 1:45 AM by David Sackstein's Blog

In this post we will develop a WCF service that is capable of participating in a client transaction.

# WCF Transactions – Barebones Demo – Part 3

Monday, June 15, 2009 2:20 AM by David Sackstein's Blog

In this final post in the series we will develop the client side of a WCF service that is capable of

# WCF Transactions ??? Barebones Demo ??? Part 4 - David Sackstein&#39;s Blog

Pingback from  WCF Transactions ??? Barebones Demo ??? Part 4 - David Sackstein&#39;s Blog

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above:
Powered by Community Server (Commercial Edition), by Telligent Systems