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's difference between Datagrid, Datalist and repeater? The Datalist ,Datagrid, and Repeater are all ASP.NET data Web controls. They have many things in common such as Da

How do we connect to SQL SERVER, which namespace do we use ? The code is shown below, after that i will  give the explanation for it. For this sample we will also require a SQL

Project Description: We are seeking experienced .NET developers (possibly certified) to work with us on several future projects. You will have to pass a simple test to be consid

I need Complete ERP Solution of Jeweler Manufacturing Project Description: MY Project Have Complete ERP Solution of jewellary manufacturing Process. By Using of my software y

SOAP Web Services A SOAP Web Service that supports three operations: add a bibliography entry, delete a bibliography entry and list all bibliography entries. You may design fo

I am seeking someone (person or company) who already has been developing some ASP.NET MVC 4 application with the subsequent requirements (so there is no need to spend extra time to

UDP Based, Data Transfer Server/ Client in .NET C# Project Description: We require the Network Level Functionalities (NLFs) of a Server/ Client for transferring data among tw

Consuming a web service with SOAP on c# .NET Project Description: I need to consume a web service with SOAP. I have xml file and some description. I need it to be done

What are the differences between ASP and ASP .Net ?  ASP: Code is Interpreted ASP.NET: Code is Compiled   ASP: Business Logic and Presentation Logic are in a one

Project Description: The website should be CMS based; coding done only on ASP, MySql databases, .net script, aspx and java use with least of the flash work. We will be sharing j