msdtc

How do I enable MSDTC on SQL Server?

大憨熊 提交于 2019-12-17 04:14:51
问题 Is this even a valid question? I have a .NET Windows app that is using MSTDC and it is throwing an exception: System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool ---> System.Runtime.InteropServices.COMException (0x8004D024): The transaction manager has disabled its support for

Distributed transaction with MSMQ and SQL Server but sometimes getting dirty reads

為{幸葍}努か 提交于 2019-12-12 18:36:07
问题 Our SQL Server 2014 database is set to READ_COMMITTED_SNAPSHOT . We use MSMQ and distributed transactions (we use MassTransit 2.10) In one part of our system we read a message from the queue, make database updates and then publish a new message to the queue (all under a single transaction). We have found a situation where it seems that the update are not committed when the next message is processed (it reads from the same table the first part updates) even though I would expect that message

MSDTC issue with transactions in ADO.NET Entity Framework

我们两清 提交于 2019-12-12 10:47:55
问题 in our current project we are using ADO.NET Entity Framework as data layer for the application. There are some tasks which require to run in a transaction because there's a lot of work to do in the database. I am using a TransactionScope to surround those tasks. using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew)) { // Do something... transactionScope.Complete(); } The problem is as soon as i am using an TransactionScope an exception occurs:

SqlConnection and TransactionScope Timeout

こ雲淡風輕ζ 提交于 2019-12-12 10:25:03
问题 I have a TransactionScope (over DTC, read committed) with a timeout of 60 minutes. In the TransactionScope I have opened the connection (I hope to enlist in the transaction) but after 30 seconds I get a timeout. In the machine.config I changed the system.transaction maxTimeout to 60 minutes. Why does the timeout occur after 30 seconds? 回答1: A SqlCommand already has a CommandTimeout property that defaults to 30 seconds. May be you are using it within your transaction. 来源: https://stackoverflow

Am I using TransactionScope and DataContext properly?

不打扰是莪最后的温柔 提交于 2019-12-11 11:54:32
问题 What if I new up some DataContexts, read some data, and then only wrap the SubmitChanges in a TransactionScope? string conn1 = GetConn1(); string conn2 = GetConn2(); using (DataContext1 dc1 = new DataContext1(conn1)) { List<Customer> customers = ReadSomeData(dc1); ModifySomeCustomers(customers); //performs local modification to Customer instances using (DataContext2 dc2 = new DataContext2(conn2)) { List<Order> orders = ReadSomeData(dc2); ModifySomeOrders(orders); //performs local modification

MSDTC Exception during Transaction: C#

与世无争的帅哥 提交于 2019-12-11 11:51:46
问题 I am getting a MSDTC exception in a Transaction in a C# application. The functionality is to upload one lakh (one hundred thousand) zipcode records into database tables after reading from a csv file. This operation is done in around 20 batch database operations (each batch containing 5000 records). The functionality is working fine, if I don’t use transaction. The interesting part is that other functionalities that uses transactions are able to complete their transactions. This leads me to an

Using transactions across processes

佐手、 提交于 2019-12-11 01:55:25
问题 I'm trying to use System.Transactions (TransactionScope) to coordinate a set of processes, each of which does some database work. Ultimately all processes need to commit or be rolled back atomically via one parent process. Unfortunately, nothing I've tried so far works. My basic strategy is to TransactionScope in the parent process, save it to a file, and invoke a child process, which loads the file, uses the transaction inside its own TransactionScope, and returns to the parent. But this

SqlConnection and avoiding promotion to MSDTC

谁说我不能喝 提交于 2019-12-10 01:56:52
问题 When we need to do database access in our application, we use the following patterns: For querying, we have a static factory class with a method CreateOpenConnection which does nothing more than new SqlConnection(myConnectionString) and calls Open() on it. This method gets called before we do a query and the connection is disposed after the query returns. For inserts/updates/deletes we use a Unit of Work pattern where the changes are batched up and submitted to the database with a call to

TransactionScope - The underlying provider failed on EnlistTransaction. MSDTC being aborted

China☆狼群 提交于 2019-12-09 08:15:46
问题 Our team have got a problem that manifests as: The underlying provider failed on EnlistTransaction; Cannot access a disposed object.Object name: 'Transaction'. which seemed to appear as soon as we began using TransactionScope to handle our applications' transactions. The top part of the stacktrace is captured as: at System.Data.EntityClient.EntityConnection.EnlistTransaction(Transaction transaction) at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectContext

Is Active Directory transaction-aware?

笑着哭i 提交于 2019-12-09 05:12:22
问题 Simple question but I can't find the answer anywhere: is Active Directory transaction-aware? In other words, will the following change be rolled back (since I didn't call scope.Complete() ): using (var scope = new TransactionScope()) { DirectoryEntry entry = ...; entry.Properties["givenName"].Value = "New Given Name"; entry.CommitChanges(); } If not, is it possible to enable this somehow? Right now I have code that performs database updates and corresponding AD updates and I have compensating