Transaction across different connections.

T

Tim Marsden

Hi,

I wish to update several databases using both OLEDB and SQLClient data
providers with in same procedure. I am using VB.NET and ADO,NET. I want all
updates to succeed, or Rollback them all. How can I achieve this using ADO
Transactions.

Tim
 
P

Pablo Castro [MS]

In general, when you need a transaction that spans multiple
servers -potentially from different database vendors- you have to use
distributed transactions. The easiest way of using distributed transactions
in the .NET environment is through COM+, a.k.a. Enterprise Services in the
managed world.

I'd suggest to take a look at "Writing Serviced Components" at the MSDN.

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tim Marsden

Thanks for the advise,

however COM+ is not an option, should I have a transaction per connection ?

Tim
 
P

Pablo Castro [MS]

If you have different local transactions transaction in different
connections, then you may commit the first and then get an error from the
second one. If your application logic can deal with that then it's ok,
otherwise you'll need a way to coordinate the transactions (which is what
dtc (com+) does)

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top