Implement dtc in .net, DOT NET Programming

How to implement DTC in .NET

DTC is implemented using the COM+.

Following are some of the steps to implement COM + in .NET:-

1) The "EnterpriseService" namespace has all the classes by which we can implement the DTC in .NET. You have to add reference "EnterpriseService" namespace.

692_implement DTC in .NET.png

2) You must derive your class from "Serviced Component" object.

3) After that you have to define your class with the transaction attribute 

      [ Transaction(TransactionOption.RequiresNew) ]

4) When the class level transaction type is defined.  Now its  time to define at the method level the AutoComplete attribute. Autocomplete attribute explains that if no exception is thrown then mark its part of the transaction as okay. This helps to cut down on the amount of code required. If the implementation sets AutoComplete to false, or omits it altogether, then we would require to manage the transaction manually. For manually control the transaction you will require to use the ContextUtil class & its static members.

 

public void SampleFunction()

{

try

{

// Do something to a database

// ...

// Everything okay so far Commit the transaction

 ContextUtil.SetComplete();

}

catch(Exception)

 {

// Something went wrong Abort and Rollback the Transaction.

 ContextUtil.SetAbort();

}

}

 

5)The Component which is  derived from "ServicedComponent" must  be strong named as they run under COM+.

6)Once the classes are compiled using the string name.Register the Component in COM+ services using

 regsvcs c:\DllPath\TransactionComponent.dll

7)The component is registered by using the COM+ explorer.

Posted Date: 9/21/2012 7:29:39 AM | Location : United States







Related Discussions:- Implement dtc in .net, Assignment Help, Ask Question on Implement dtc in .net, Get Answer, Expert's Help, Implement dtc in .net Discussions

Write discussion on Implement dtc in .net
Your posts are moderated
Related Questions
What is nested Classes? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of ac

What is the difference between "Web farms" and "Web garden"? The "Web farms" are used to have some redundancy to reduce the failures. It consists of two or more web server of t

What is PLINQ? PLINQ stands for Parallel Language Integrated Query. It is the parallel execution of LINQ, in which a query can be implemented by using multiple processors. PLIN

I want a Panel for youtube views and facbook likes. I need a panel made that can increase facebook fanpage likes, and that will increase youtube video views. Youtube views an

Project Description: I need a SharePoint Developer tutor to teach me the development of SharePoint from scratch. We will be communicating through TeamViewer and Skype. I have ac


how to replace a keyword using powershell

Explain ADO.NET in brief. ADO.NET is a very significant feature of .NET Framework, which is used to work with data that is stored in structured data sources, like databases and

Project Description: We're seeking an IT candidate with experience to help us optimizely,  Skills required: .NET, C# Programming, ASP, eCommerce, SQL

What is difference between System.String and System.StringBuilder classes? String and StringBuilder classes are used to store string values but the dissimilarity in them is tha