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

Define an array, Define an array. An array is explained as a homogeneou...

Define an array. An array is explained as a homogeneous collection of elements, stored at contiguous memory locations, which can be referred by the similar variable name. All t

Manager, How to get Herarichal Data in Treeview control from sql server dat...

How to get Herarichal Data in Treeview control from sql server database in asp.net , can you provide the source code .

Develop skype recorder application, Develop Skype Recorder Application + Se...

Develop Skype Recorder Application + Setup + Sourcecode + NICE UI Project Description: i need an application built which will allow user to record skype audio or video calls

Post cache substitution, What is Post Cache substitution? The Post cach...

What is Post Cache substitution? The Post cache substitution is used when we want to cache the complete page but also require some of the dynamic region inside that cached page

Gmail, how make the google sign up page?

how make the google sign up page?

Want a database management app, Project Description: Overview: Prepar...

Project Description: Overview: Prepare Windows program that runs in the background and on start up on the client's computer that grabs CERTAIN data from a.SDF file (SQL Serve

Com components use in .net, How can COM Components use in .NET? The .NE...

How can COM Components use in .NET? The .NET components can communicate with COM using RCW (Runtime Callable Wrapper). The ways with which you can generate RCW are as shown bel

Dynamic web presentation tier, Part 1 requires you to complete a dynamic we...

Part 1 requires you to complete a dynamic web presentation tier, based on your MiddlewareLib.dll  library. This should run as an ASP.NET page, Default.aspx, under WebDev.WebServer,

Develop mobile web app, Project Description: This project uses Microsoft...

Project Description: This project uses Microsoft Visual Studio 2010/2012, Internet Information Services (IIS) Manager and Microsoft SQL Server Management Studio. It is a Mobi

Microsoft application blocks, Have you ever worked with Microsoft Applicati...

Have you ever worked with Microsoft Application Blocks, if yes then which? The Application Blocks are C# & the VB.NET classes distributed as the Visual Studio projects which ca

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