none
Using WCF to handle distributed transaction RRS feed

  • Question

  • We have a requirement for a very specific scenario to implement distributed transaction in WCF service.  Here is the scenario:

    1.        Client makes a call to WCF Service
    2.        WCF Service updates Data in SQL Server
    3.        It makes a call to an external Java based web service which is responsible to update the same data in DB2 database

    If anything fails in the above scenario, the entire transaction has to be rolled-back.  How we enable distributed transaction for the above scenario. Any inputs in this regard will be helpful. I understand Distributed transactions cause myriads of problems. However, I would like to know the potential solutions for the above issue.

    Tuesday, February 23, 2016 12:11 PM

Answers

  • We have a requirement for a very specific scenario to implement distributed transaction in WCF service.  Here is the scenario:

    1.        Client makes a call to WCF Service
    2.        WCF Service updates Data in SQL Server
    3.        It makes a call to an external Java based web service which is responsible to update the same data in DB2 database

    If anything fails in the above scenario, the entire transaction has to be rolled-back.  How we enable distributed transaction for the above scenario. Any inputs in this regard will be helpful. I understand Distributed transactions cause myriads of problems. However, I would like to know the potential solutions for the above issue.

    The server machines hosting the WCF service and MS SQL Server must have MSDTC enabled. I don't know what you have to do on what I would assume is a Linux machine, but it too must participate in the MSDTC transaction. The client machine may need MSDTC enabled, and the client may need to start the transaction.

    https://msdn.microsoft.com/en-us/library/aa342335%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396

    Tuesday, February 23, 2016 4:39 PM