Solved

Transactions without MSDTC

Posted on 2009-07-16
4
801 Views
Last Modified: 2013-12-17
I am looking for a solutions to the following problem:

I need to be able to handle transactions across multiple sql servers without invoking MSDTC.  I know there has to be a way to do this by enlisting in a transaction that i implement myself, i'm just not finding any information on how to do it without using MSDTC.  

I know that the "autoEnlist=false" will keep the transactionscope object from starting DTC, but i can't find examples managing transactions without msdtc.

Please help!!
0
Comment
Question by:kmitch62
  • 2
  • 2
4 Comments
 
LVL 41

Expert Comment

by:graye
Comment Utility
That's a bit odd... since Microsoft wrote the Distrubuted Transaction Coordinator service specifically for this scenario
What's your beef with MSDTC?
0
 

Author Comment

by:kmitch62
Comment Utility
Personally, I don't have any beef with it.  The organization i'm working for feels that there are performance issues that they can't have in their OLTP application.

I'm aware that MSDTC is basically the standard, but I have to live within my constraints.
0
 
LVL 41

Expert Comment

by:graye
Comment Utility
Ok... I'm assuming we are talking about a database transaction?  If so tell more about the databases (SQL Server 2008?)
0
 

Accepted Solution

by:
kmitch62 earned 0 total points
Comment Utility
I've worked out the answer.

1. use the transactionscope object with the "autoenlist=false" in the connectionstrings of the connections.  if you don't use autoenlist=false, transactionscope automatically tries to enlist in MSDTC.
2. create an object that inherits DbTranaction and IEnlistmentNotification
3. When the connection is instanciated, you have to manually create the object in #2 and then enlist in the abient transaction with Transaction.Current and Transaction.EnlistVolitile method
4. write the object in #2 to override the iEnlistmentNotification methods.
5.when all transaction functionality is completed, call TransactionScope.Complete.  This will commit all the contained transactions.  If an error is thrown by any of the transaction functionaltiy, the transactionscope will rollback all contained transactions.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now