How to implement nested SQL transactions with ADO.NET?

Posted by manza_jurjur on Stack Overflow See other posts from Stack Overflow or by manza_jurjur
Published on 2010-04-09T11:31:46Z Indexed on 2010/04/09 11:33 UTC
Read the original article Hit count: 162

Filed under:
|
|
|

I need to implement nested transactions in .NET using ADO.NET.

The situation is as follows:

--> Start Process (Begin Transaction)
   --> Begin Transaction for step 1
   --> Step 1
   --> Commit transaction for step 1

   --> Begin transaction for step 2
   --> Step 2
   --> Rollback transaction for step 2

   --> etc ...

--> End Process (Commit or Rollback ALL commited steps)

Can that be done with transaction scopes? Could anyone post an example?

In addition I'd need the prcoess to work for SQL Server 2005 AND Oracle 10g databases... will transaction scopes work with both database engines?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ADO.NET