how to make a transaction across two WCF methods

J

Johndow

I am new to WCF, so please point me to the right direction.

I created 2 WCF serivces, each one uses a difference database connection in
the back end.
Now from the client application, I need to keep two methods call to the
service in one transaction.


using (TransactionScope scope = new TransactionScope())
{
using (Proxy1 proxy = new Proxy1())
{
proxy.Method1();
}
using (Proxy2 proxy = new Proxy2())
{
proxy.Method2();
}
scope.Complete();
}

Above code does not work. If there is exception in Method2, Method1 still
commit.

What will be the right way to make transcation across multiple WCF services?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top