Search code examples
.net-4.0transactionscopemsdtc

The PROMOTE TRANSACTION request failed because there is no local transaction active


Under what circumstances would I see the above message? I have a single call to SQL Server which is wrapped in a call to TransactionScope. In our development and QA environments MSDTC is turned off and the call succeeds fine. However, in our production environment with MSDTC turned on we are failing with this call. Is there something that would cause this when I am sure we are not looking at a distributed transaction call at all?


Solution

  • Ok, so the problem was that we had a CreateTransaction call around the call AND a TransactionScope. So we DID have 2 transactions. I didn't think that this would cause this type of problem until I realized that when there was an error we would end up with two ROLLBACK calls. The second one would trigger the above error message and effectively hide the first. We found this by running SQLProfiler looking for "User Error Messages"