Using System.Transactions.TransactionScope and MSDTC

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • G.S.

    Using System.Transactions.TransactionScope and MSDTC

    Is there a way to use transactions from within C# code without using
    MSDTC (client-and-server environment where the SQL server is behind a
    firewall)?

    Thank you
  • G.S.

    #2
    Re: Using System.Transact ions.Transactio nScope and MSDTC

    On Aug 21, 4:34 pm, "G.S." <gstoy...@gmail .comwrote:
    Is there a way to use transactions from within C# code without using
    MSDTC (client-and-server environment where the SQL server is behind a
    firewall)?
    >
    Thank you
    I guess I'll reply myself :)

    If the target database is SQL 2005 and certain conditions are met, the
    TransactionScop e will stay "light-weight" and will not be promoted to
    a full-blown MSDTC transaction.

    From reading this up quickly it looks the condition is to only create
    the DB connection once and pass it around throughout the body of the
    transaction.

    Would somebody comment if there's a way to explicitely request a LWT
    since I know I only hit ONE SQL Server 2005.

    Thanks

    Comment

    • G.S.

      #3
      Re: Using System.Transact ions.Transactio nScope and MSDTC

      On Aug 21, 4:59 pm, "G.S." <gstoy...@gmail .comwrote:
      On Aug 21, 4:34 pm, "G.S." <gstoy...@gmail .comwrote:
      >
      Is there a way to use transactions from within C# code without using
      MSDTC (client-and-server environment where the SQL server is behind a
      firewall)?
      >
      Thank you
      >
      I guess I'll reply myself :)
      >
      If the target database is SQL 2005 and certain conditions are met, the
      TransactionScop e will stay "light-weight" and will not be promoted to
      a full-blown MSDTC transaction.
      >
      From reading this up quickly it looks the condition is to only create
      the DB connection once and pass it around throughout the body of the
      transaction.
      >
      Would somebody comment if there's a way to explicitely request a LWT
      since I know I only hit ONE SQL Server 2005.
      >
      Thanks
      ... another condition that some posts on the internet hint may trigger
      escalation to a distributed transaction seems to be usage of aliases
      instead of the SQL server instance name.

      Comment

      Working...