ADO.NET 2.0 Transactionscopeoptions clarity RRS feed

  • Question

  • Can someone show me(or provide the links) with proper and complete examples, the difference between different transactionscopeoptions(Required,RequiresNew, Supress). I have been unable to find complete and descriptive examples through net.


    Tuesday, December 18, 2007 7:09 PM


All replies

  • EDIT


    Beyond the docs which is very clear with the Transactionscope options the long tutorial in the link below covers what you need to know about System.Transaction class.  One more thing TransactionScope options are in System.Transactions not ADO.NET, they are application layer transcations not the same with ADO.NET transaction which is in Data Access.



    Tuesday, December 18, 2007 8:36 PM
  • Thanks for replying. I had gone through the article in the link that you have posted, before. The article though explains the concepts very well, doesnt give practical examples. The examples which the link sites are more kind of generic. I was specifically looking for real world examples which would make my understanding clearer, with reagrds to the transactions.

    One example quoted from the article is given below

    using(TransactionScope scope1 = new TransactionScope())
          //Start of non-transactional section
          using(TransactionScope scope2 = new
             //Do non-transactional work here
          //Restores ambient transaction here
       //Rest of scope1

    This just explains the generic steps but doesnt give the detailed picture in totality something like a real world scenario and the behaviour of transactions in that scenario. I hope you understand what i am asking for. If you could refer me the links with complete examples, it would be nice.




    Tuesday, December 18, 2007 8:46 PM
  • Complete examples are not easy to find because the Transaction Programming team deals with only application layer transaction while the ADO.NET team has very good atomic transaction with clean nesting but in Data Access.  That said here are three that may help.


    He was a member of the team at the time of this posting now he is part of the ADO.NET team and I found out most issues relevant to SQL Server from his postings.



    He is a member of Transaction Programming team so an expert.




    The Docs covering the options.


    Tuesday, December 18, 2007 9:21 PM