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 resource files? The Resource files are the files which contain program resources. Many programmers think that resource files are used only for storing strings. But you

I want .Net Programmer for custom grid web application Need programmer to support in the development of an ASP .Net interface. Project will make extensive utilize of custom grid

Perform Arithmetic Operations - c# Program Hello, i didn't find the correct way of using arithmetic operations in c#. I am beginner for this language. Please suggest me some e

What are the naming conventions required for XML elements tags? The following are the naming conventions that need to be followed for XML elements tags: Element names should

What is an IL? Intermediate Language is also called as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. IL

Give a brief introduction on side-by-side execution. Can two applications, one using private assembly and the other using the shared assembly be stated as side-by-side executables?


I need CELL PHONE PINGING for fugitive tracking Project Description: I want an application like the following: it provides cell phone pinging(location information via gps) wi

What is a DataReader object? The DataReader object helps in retrieving the data from a database in a forward-only, read-only mode. The base class for all the DataReader objects

Mention the name of the directory where it is essential to locate the proxy file to use a Web service. The proxy file must be kept in the /bin directory. This directory is situ