Using TransactionScope()

Discussion in 'ASP.NET 2.0' started by dotnetster, Mar 16, 2008.

  1. Hi all,

    Has anyone had any problems using the TransactionScope class in the System.Transactions namespace? It works fine for me locally, but my code falls down when I upload it to the DiscountASP.NET server. I read somewhere that the Distributed Transaction Coordinator service has to be running to use this class. Does anyone know any more re: this? My intention is to use a transaction to make sure that the entire order (with order lines) is commited to the database, or nothing at all (if the event of something going wrong).

    My code looks something like:

     
  2. I have never used TransactionScope but it does indeed look very cool. [​IMG]
    Doing a quick search just now I found this article:
    http://www.codeproject.com/KB/database/TsFix.aspx

    I can't answer any specific question regarding this but I did find that article very interesting.
    Salute,
    Mark
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    This won't work on our server because of certain technical difficulties related to the server setup.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. jc1

    jc1

    I thought it was because of the dependence on distributed transactions that is inherit and supported, although not always required, when using transaction scopes.
     
  5. JorgeR

    JorgeR DiscountASP.NET Staff

    The line of code should not have no problems when executed from your .net application


    junior

    DiscountASP.NET

    www.DiscountASP.NET
     
  6. Hey Bruce,

    Cheers for letting me know. Do you know if the following will work:

     

Share This Page