Question

I have client-server app. Client is a .NET 4.0 app. Server is stateless WCF (.NET 4.0) service. WCF service does some CRUD with SQL Server 2005 database. WCF is configured to support transactions. Services should be stateless for the sake of scalability. There are several instances of WCF service on different physical machines. They are behind the load balancer. If we have the following code of the client:

using (var scope = new TransactionScope())
{
  var proxy1 = new WCFServiceProxy();
  proxy.DoSomeDBStuff1();
  proxy.DoSomeDBStuff2();

  scope.Complete();
}

these two service requests may be served by different instances of WCF service. Will these transactions work a proper way?

Was it helpful?

Solution

They should work properly. Transaction's 2 phase commit should work across different machines, regardless if they are under the same load balancer or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top