The sample resource manager

The focus of the next few posts won't be focused on the System.Transactions resource manager interfaces.  However, in order to be able to ground discussion in some examples, I'm going to lay out the external view of our target resource manager.

 

Our resource manager will manage a name/value pairs -- it will be a property bag, in other words.  The values can be objects, the names are strings.  It will support the normal CRUD actions: I can insert new names into the bag, I can remove names from the bag, I can read values associated with a name, and I can write new values associated with a name.

 

I can access the property bag simultaneously from several threads in several transactions.  Once we've done that, we'll make it durable.  Finally, we'll make it support access from multiple processes.

 

So far, the property bag looks like:

 

public class TxPropertyBag

{

public TxPropertyBag ();

public TxPropertyBag (string bagName);

 

public string BagName

{

get;

}

 

 

public object BagValue (string name)

{

get;

set;

}

 

public void RemoveBagValue (string name);

public void AddBagValue (string name, object value);

}

 

Note that we could have modeled the bag more closely to a normal collection.  I've not done so thus far in order to help keep the focus on how to make the property bag transaction aware.

 

Update: As a final step, we'll extend the property bag interface with an ability to enumerate the properties in the bag.


Posted Jan 24 2006, 07:55 PM by jim-johnson

Comments

Stephen Brag wrote re: The sample resource manager
on 01-24-2006 9:24 PM
Jim -- This is great. This is going to be an interesting story. I'm looking forward to it.

I hope your sample will also show enumeration. It is always challenging to make this performant in a multi-thread multi-transaction environment.
Jim Johnson wrote re: The sample resource manager
on 01-25-2006 7:09 AM
I hadn't initially planned to. However, it does bring up a bunch of interesting challenges (I would agree that it is hard to make it performant, partially because it is harder than the other cases to define what it means to make it right :) ). I'll update this and add that as a final step after distribution.

Jim.
Vijay Srinivasan wrote re: The sample resource manager
on 01-26-2006 7:30 AM
Hi Jim,
How about making the property bag persistent as well, just to ensure that we are being able to make the underlying data (that the bag carries) durable on succesfull completion of the prepare phase.

May be than you may also want to have a semantics similar to locks that this RM hold and release them during the commit phase. Just the way SQL Server or some other RM would work. In that way we can model and test isolation levels as well. what say? :-)
Jim Johnson wrote re: The sample resource manager
on 01-26-2006 7:18 PM
Vijay,

Yes, I do intend to include durability, as a second stage in the project.

Jim.
A Nonny Mouse wrote re: The sample resource manager
on 01-27-2006 2:10 PM
Are you the famous Techno Toys Jim Johnson?
Jim Johnson wrote re: The sample resource manager
on 01-27-2006 2:26 PM
No, 'fraid not.

Jim.
MADHU BLOG(MSDTC/COM+/WEB SERVICES/WCF) wrote How to implement Resource Manager in SYSTX?
on 04-05-2006 10:16 AM
Following links will help you to write resource manager by using SYSTX classes
 
http://msdn2.microsoft.com/en-us/library/ms229975(VS.80).aspx...
John Lan wrote re: The sample resource manager
on 11-29-2006 6:38 AM
Jim, can MSDN provide a workable, mini resource manager sample? this would be great to help understand MSDTC behavior and trouble shooting.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?