Nested Transaction

U

UncleJoe

Hi all,

I would appreciate some pointers on how to implement nested
transactions in ADO.NET. Take the following code as an example:

SqlConnection conn = new SqlConnection(connStr);
conn.Open();
SqlTransaction tran =
conn.BeginTransaction(IsolationLevel.ReadUncommitted , "OuterTran");
process1();
process2();
process3();
tran.Rollback("OuterTran");

Process1, Process2 and Process3 are originally three separate processes
not meant to work together so they each open its own connection and
transaction. As you can see I am trying to wrap them together in a
nested transaction so that the outer shell can have a final say. Is
that do-able? My testing result indicates that the outer transaction
was ignored completely. Any insight will be greatly appreciated.
 

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