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

I want a c# windows app, I want a C# Windows App Project Description: ...

I want a C# Windows App Project Description: Windows App written in C# that can: Check for Internet connection Load dynamic web site If Internet connection drops rec

Are you available to discuss about my project, Are you available to discuss...

Are you available to discuss about my project. I'd like you to show first and then accept the project provided if we both agree to continue with each other. Skills required:

I would like to develop a new website, I would like to develop a new websit...

I would like to develop a new website to compete with an existing one: greatandhra I would like the new website to be less flashy, more content driven and be inspired from below

Print pyramids of numbers - c# program, Print Pyramids of Numbers - C# Prog...

Print Pyramids of Numbers - C# Program Hello can you please provide me some examples regarding to the Print Pyramids of Numbers in C#.

What is the appfabric component, What is the AppFabric component? The A...

What is the AppFabric component? The AppFabric component is used to make access control and dole out messages across clouds and enterprises. It has a service-oriented architect

Why is it preferred to not use finalize for clean up, The Problem with fina...

The Problem with finalize is that the garbage collection has to make 2  rounds in order to remove the  objects which have finalize methods. The figure below will make things cle

How would you implement inheritance using vb.net, How would you implement i...

How would you implement inheritance using VB.NET? When we set out to execute a class using inheritance, we must first begin with an existing class from which we will derive our

Hwid spoofed for windows 7, HWID Spoofed for Windows 7, 8 x64 Project De...

HWID Spoofed for Windows 7, 8 x64 Project Description: I require a simple program that will spoof my hardware id. I could be able to write the id to spoof to in the program a

Asp.net 2.0 application port to asp.net mvc, Project Description: Legacy...

Project Description: Legacy ASP.NET application for managing tasks for a private client needs a complete re-write. The application has approximately 2500 lines of code, combi

What are assemblies, What are Assemblies? Assembly is a single deployab...

What are Assemblies? Assembly is a single deployable unit that have information about the implementation of classes, structures and interfaces. It also keeps the information ab

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