Implement dtc in .net, DOT NET Programming

Assignment Help:

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.


Related Discussions:- Implement dtc in .net

Login page, how to connect login page with my database and check the values...

how to connect login page with my database and check the values with the database.

List the session variables names and values, Question: (a) One of the ...

Question: (a) One of the advantages of the Session object is that it prompts to you when a user session begins. In this context, a user fills in a registration form and the Se

Explain class, What is a class? A class explains all the attributes of ...

What is a class? A class explains all the attributes of objects, as well as the methods that execute the behavior of member objects. It is a comprehensive data type, which show

Explain the xml elements, Explain the XML elements. The elements are th...

Explain the XML elements. The elements are the central units of an XML document that define and identify data. The elements are represented by the tags. You can also make your

Define the tooltip control, Define the ToolTip control. How can you associa...

Define the ToolTip control. How can you associate it with other controls? The ToolTip control produces a small pop-up window with explanatory text for an element it is displaye

Cross page posting, What is cross page posting? By default, the button ...

What is cross page posting? By default, the button controls in the ASP.NET pages post back to the similar page that contains button, where you can write an event handler for th

Decision making and branching - c# program, Decision Making and Branching -...

Decision Making and Branching - C# Program Need Programming help on Decision Making and Branching in C#.

I need very easy project in metatrader, I need very easy project in metatra...

I need very easy project in metatrader Project Description: I have 3 indicators.... ADX, emas crossover and macd crossover! They are all signals, arrows! But i would like to

Define the term viewstate as used in the asp.net framework, Problem: (a...

Problem: (a) Define the term ViewState as used in the ASP.NET framework. (b) What is a StateBag class? Give a simple example to support your answer. (c) (i) Distingui

Precautions for sqlserver mode, What are the precautions by which SQLSERVER...

What are the precautions by which SQLSERVER Mode work properly Following are the things to keep in mind so that the SQLSERVER Mode works properly:- A) In the SQLSERVER mode,

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd