Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distributed transaction

Status
Not open for further replies.

newbie14

Technical User
Feb 14, 2009
81
0
0
MY
Dear All,
I have a C# application where I need a distributed transaction. I need to update 2 database one local and one remote. Is there any idea how to to do it? Any code snippet will be helpful? Thank you.
 
Do you just want to open connections to two databases on two seeprate servers or do you want to do a real two-phase commit transaction.
If it's the former, that's easy enough just open two ADO.NET connection in the C# code. If it's the latter you will need to make sure that the provider you are using will enlist in a distributed tranaction (I think the MYSQL .NET provder does) and then run you aplication under a distributed transaction coordinator(what used to be DTC) running uner MTS (or .net transaction services as I think it's called these days, its also been called COM+).
If you running Tuxedo or Encina for windows you will have to consult thier documentation.
Best bet it to look at the documentation or ask in the C#/.NET forums, it should be straight forward.
 
Dear Ingresman,
I would like to do the former one open the connection and commit together. So I would want the real two-phase commit. Is there any sample code how to go about it. I have checked the mysql .net connector is not supporting yet. Any other option please.
 
Have a look at this
and
However
Seems to indicate that the mysql connector does not support transactions
But
Says the the Java connector does support distributed transactions (XA)
So it's looks a little confused !, you could also try the ODBC connector which I can't see specific reference to XA but is a rewrite do probabbly does.
Try some of the examples and see if it works !
 
Dear Ingresman,
Actually the reason why I was using .net connector was that first I read an article stating that .net connector is much faster then odbc. So actually what is odbc and oledb.net. I am a bit confusing do you think I must go back to there ? Thank you.
 
To behonest I'd try and find some articles on data access under windows. It should save you a lot of trouble in the long run.
 
Dear Ingresman,
I dont get you when you said you have tried? Actually what do u mean you have tried what .net connector or oledb or odbc? From your experience which is better now? Thanks.
 
I've never tried to do a distributed two phase commit (XA) using MYSql.
I think the performance differecne betweeen the ODBC/OLD Db/ .net probabbly only matters if you have a very high throughput application. Twp Phase Commit is quite a slow protocol so I would think you wouldn't see a great deal of difference.
I'm also not really sure what your asking me in your last post.
 
Dear Ingresman,
Since .net connector does not support two phase commit so what is your option for me to try do you think I should try it with ole db.net or odbc ? So which one have you use I mean in you db software application for thow phase commit ?
 
how can I put this.....
I've never done a two phase commit
Try the ODBC connector for yourself !.
for a .NET application you don't have any other options I'm afraid.
 
Dear Ingresman,
Ok then I just would like to know further details from you wat is odbc and oledb.net what is their difference?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top