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 are the  steps of acquiring a proxy object in Webservice? The following steps are required to get a proxy object of a webservice at the client side:- 1.     The Clie

Djvu view and setup,  sourcecode with nice UI Project Description: i want an application build for viewing djvu files -must include setup -must include source code -

Question 1 Discuss the following with respect to .NET Technologies Web Applications Web Server Connections Question 2 Write a sample program using ASP.NET explain

How to use a checkbox in a datagrid? The steps to be done are as follows:- 1)    In the ASPX page you have to add Itemtemplate tag in datagrid. 2) I

Explain different software development life cycles. The System Development Life Cycle (SDLC) is the overall process of developing information systems through multi stage proces

Write a C# program (C# console application) that plays a word game with the user. The program should ask the user to enter the following: • His or her name • His or her age

Project Description: This is a full time contractual role seeking for a sports advisory service. We are data insights consultancy specializing in sports. We consult to a number

Different types of remote object creation mode in .NET There are 2 different ways in which the object can be created using Remoting :- 1)SAO (Server Activated Objects) also

Develop a Earnings Calculator for my Paid to Click Website Project Description: I want a calculator which will show my members how much they could earn, with value per click,

Add in bitcoin payment option in website Project Description: Include bitcoin files to magento for payment options on website. It is just including the files to the magent