1

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?

vahdet
  • 6,357
  • 9
  • 51
  • 106
Raj
  • 77
  • 2
  • 10

1 Answers1

0

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.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • I cannot see a TransactionFlow attribute which implies a new transaction is created and then committed when this operation contract is called. I am leaning towards getting rid of this even if the call is invoked from within a transaction scope by an external application. – Raj Aug 17 '18 at 13:11
  • 1
    If it's just used to save on three lines doing a local transaction manually, you could as well delete it and create a transactionscope manually in every method. – nvoigt Aug 17 '18 at 13:31