Transaction across different connections.

  • Thread starter Thread starter Tim Marsden
  • Start date Start date
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
 
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.
 
Thanks for the advise,

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

Tim
 
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.
 
Back
Top