Home All Groups Group Topic Archive Search About

Nested TransactionScopes

Author
30 Jun 2006 1:41 PM
Steve B.
Hi,

If I have something like this :

using(TransactionScope t1 = new TransactionScope())
{
  using(TransactionScope t2 = new TransactionScope())
  {
    // Do something with SqlServer
    t2.Complete();
  }
  // Do something else with SqlServer
  throw new Exception(); // Just to make it fail
  t1.Complete();
}

Will the sqlcommands executed within t2 commited ? Or will the two
transaction be dependents (t2.Complete() commits only when t1.Complete()) ?

And at last, is System.Transactions planned for Compact Framework apps ?

Thanks,
Steve

Author
30 Jun 2006 11:58 PM
Mary Chipman [MSFT]
All parts of the transaction either commits or rolls back as a single
unit of work. I don't know the answer to your last question.

--Mary

On Fri, 30 Jun 2006 15:41:53 +0200, "Steve B."
<steve_beauge@com.msn_swap_com_and_msn> wrote:

Show quote
>Hi,
>
>If I have something like this :
>
>using(TransactionScope t1 = new TransactionScope())
>{
>  using(TransactionScope t2 = new TransactionScope())
>  {
>    // Do something with SqlServer
>    t2.Complete();
>  }
>  // Do something else with SqlServer
>  throw new Exception(); // Just to make it fail
>  t1.Complete();
>}
>
>Will the sqlcommands executed within t2 commited ? Or will the two
>transaction be dependents (t2.Complete() commits only when t1.Complete()) ?
>
>And at last, is System.Transactions planned for Compact Framework apps ?
>
>Thanks,
>Steve
>

AddThis Social Bookmark Button