Runtime: Workaround for apps dependent on DTC in respect to porting to NetCore 3.0

Created on 5 Dec 2019  ·  3Comments  ·  Source: dotnet/runtime

All,

If your netcore app wraps multiple connections in a transactionscope, you will get a runtime error:
"This platform does not support distributed transactions."

I am wondering what's the best workaround for web apps that are being ported to netcore3, which used DTC. Is it to refactor to use UnitOfWork pattern?

I don't want to manage connections in my business layer, which is what TransactionScope helped with.

Thanks!

Related:
Open Issue: https://github.com/dotnet/corefx/issues/13532
Stack Overflow: https://stackoverflow.com/questions/56328832/transactionscope-throwing-exception-this-platform-does-not-support-distributed-t

area-System.Transactions untriaged

Most helpful comment

We are also wanting to port from .NET Framework to .NET Core and have ran into the fact that DTC is not supported with TransactionScope which feels like a deal breaker in terms of us being able to port to .NET Core.

Our specific use cases are:

  1. We need to write to two different database tables residing on two separate SQL Servers and ensure it is all committed to the database atomically which we do today successfully using TransactionScope and DTC.
  2. We need to INSERT/UPDATE/DELETE multiple database tables in a single transaction from our business layer code which has no knowledge of the database. We accomplish this successfully today by creating a TransactionScope in our business layer which in turn makes multiple calls to our data access layer which performs the necessary database operations.

Since distributed transactions are not currently supported right now in .NET Core, what is the recommendation from Microsoft as a workaround?

All 3 comments

We are also wanting to port from .NET Framework to .NET Core and have ran into the fact that DTC is not supported with TransactionScope which feels like a deal breaker in terms of us being able to port to .NET Core.

Our specific use cases are:

  1. We need to write to two different database tables residing on two separate SQL Servers and ensure it is all committed to the database atomically which we do today successfully using TransactionScope and DTC.
  2. We need to INSERT/UPDATE/DELETE multiple database tables in a single transaction from our business layer code which has no knowledge of the database. We accomplish this successfully today by creating a TransactionScope in our business layer which in turn makes multiple calls to our data access layer which performs the necessary database operations.

Since distributed transactions are not currently supported right now in .NET Core, what is the recommendation from Microsoft as a workaround?

We are investigating the feasibility of bringing this feature to Core, please continue to track dotnet/corefx#13532 , that issue will be getting moved to this repo shortly.

Issue moved to dotnet/runtime #715

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bencz picture bencz  ·  3Comments

sahithreddyk picture sahithreddyk  ·  3Comments

chunseoklee picture chunseoklee  ·  3Comments

ilmax picture ilmax  ·  3Comments

yahorsi picture yahorsi  ·  3Comments