I need to maintain distributed transactions in my application
Assume Service1 is installed on Server1
[ServiceContract]
IService1
{
[OperationContract]
Operation1();
}
Service2 is installed on Server2
[ServiceContract]
IService2
{
[OperationContract]
Operation2();
}
and the client is consuming the two services
using (TransactionScope ts = new TransactionScope())
{
Service1Proxy.Operation1();
Service2Proxy.Operation2();
}
Where should i exactly install the MSDTC, do it required to be installed on Server1,Server2 and client
Is it requires any additional configuration in this case ?
You would have to enable MSDTC on your clients and server 1, server 2.
you should allow outbound in the security configuration of MSDTC on your client.
you should allow Inbound and Outbound on your servers.
if your DB is on a seperate machine, it should allow Inbound.
One issue that I ran to using MSDTC, is don't forget to ALLOW MSDTC in the list of exception of your FIREWALL.
Looking at your code snippet, you'll need to add the Transactionflow attribut on your operation interface also.
Here is a good link for WCF with transactions : Foundation: Transaction Propagation