Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I would like to know if you guys have any best practice when dealing with transaction between different databases vendors.

For example, if you have a C# application that save customer data in two databases (one Oracle and the other Microsoft), what would you do?

Would you use OleDbTransaction? Is it possible?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

As long as you can turn on MSDTC on all of the clients and servers that the transaction involves, MSDTC works like magic. It is about as simple as wrapping all of your calls in a transactionScope, and setting a condition for transactionScope.Complete() to be called. Definitely look into the security/performance issues this can cause in certain circumastances though. It is generally inadviseable to operate transactions over the internet, since it can increase the potential for attacks, but it works fine on an intranet.

share|improve this answer
add comment

I believe that MSDTC is able to support transactions between different database instances. There are numerous resources about how to properly set up MSDTC and how to properly establish a transaction for your use case.

Another piece of advice I have when it comes to storing in different database instances altogether for the same application, you may run into situations where you may want to uniquely identify a particular record in one database over another, especially if there exists tables in both instances that have the same schema. You may want to consider uniquely identifying records by UID.

http://www.c-sharpcorner.com/UploadFile/prasoonk/FaqsAboutGUID06182009072827AM/FaqsAboutGUID.aspx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.