Search code examples
wcfattributestransactionscopeoperation-contract

Remove TransactionScopeRequired = true


I have an operation contract, on a windows service and it has an attribute

[OperationBehavior(TransactionScopeRequired = true)]

I would like to get rid of this attribute. Reason :

containerize the service. and Containerized apps do not support MSDTC , that's the purpose of the attribute!

What are the implications of doing this? I can confirm the code within the operation contract inserts into a single database. No events triggered, however I am unsure of whether there is a transaction where the service is consumed.

Can I get some advice on this?


Solution

  • Your service is requiring a transaction.

    Only you can know whether this is necessary, we cannot check your service and database to check.

    Please be aware that this enables not only local transactions, but -depending on binding- also enables distributed transactions. See here for details.

    You new system does not seem to support this (MSDTC is the Distributed Transaction Controller from MS). Again, whether this is a problem when you move over to this system is nothing we could find out. You will have to have a look at the system architecture and see whether this is something that was included "just because" and can be deleted without replacement, or if it's a key feature of your system that you need to keep.