TransactionScope Error Against Sql Server 2000 - Partner Transaction Manager Disables Remote / Network Transaction Support

I am trying to create a simple transaction for my Linq-to-Sql actions against my Sql 2000 database. Using TransactionScope is as follows:

using (TransactionScope transaction = new TransactionScope())
{
    try
        {
        Store.DBDataContext dc = new Store.DBDataContext();
        Store.Product product = GetProduct("foo");
        dc.InsertOnSubmit(product);
        dc.SubmitChanges();
        transaction.Complete();
    }
    catch (Exception ex)
    {                
        throw ex;
    }
}

However, I keep getting the following error:

Partner Transaction Manager has disabled remote / network transaction support. (Exception from HRESULT: 0x8004D025)

But, if I set up a transaction using a traditional transaction, it works fine. So this works great:

Store.DBDataContext dc = new Store.DBDataContext();
try
{
    dc.Connection.Open();
    dc.Transaction = dc.Connection.BeginTransaction();
    Store.Product product = GetProduct("foo");
    dc.InsertOnSubmit(product);
    dc.SubmitChanges(); 
    dc.Transaction.Commit();
}
catch (Exception ex)
{
    dc.Transaction.Rollback();
    throw ex;
}
finally
{
    dc.Connection.Close();      
    dc.Transaction = null;
}

, TransactionScope - , . , , TransactionScope? , , , . , MSDTC sql, .

+5
4

:

System.Transactions Microsoft SQL Server 2000 http://blogs.msdn.com/florinlazar/archive/2005/09/29/475546.aspx

:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1

, " " ,

1. " > "
2. " ", .

, , , ,
1. "" > " "
2. " > > " ( , )
3. " ", ""
4. "MSDTC"
5. " "
6. , " DTC", " ", " /", " TIP" (, , )
7. . 8. , ( , )

, " " , " DTC ", " /", .

SQL Server "", " ", .

+6

DatabaseTransactionAdapter , , , . , :

Store.DBDataContext dc = new Store.DBDataContext();
using (TransactionScope transaction = new TransactionScope())
{
    try
    {
        var dbAdapter = new DatabaseTransactionAdapter(dc.Connection);
        dc.Connection.Open();
        dbAdapter.Begin();
        dc.Transaction = (SqlTransaction)dbAdapter.Transaction;
        Store.Product product = GetProduct("foo");
        dc.InsertOnSubmit(product);
        dc.SubmitChanges();
        transaction.Complete();
    }
    catch (Exception ex)
    {                
        throw ex;
    }
}

, , , , 'using'.

, , .

, , , "" . , .

+2

Windows 2008 :

, " " ,

  • " > "
  • " ", .

, ,

  • "" > " "
  • " > > p > " ( , )
  • "Local DTC", ""
  • ""
  • , " DTC", " ", " /"
  • .
  • , ( , )

, " ", , " DTC", " /", , , .

SQL -, "", "" ", .

+1

, : - COM + (Windows Server 2003) == > == > == > Windows, . " COM +" "". "", "".
- , / : "" > " " == > "" == > " ". " ", "", " " "". " " " ", TCP/IP, , . "" DTC. OK, . .

0

All Articles