WCF Transaction Scope SQL insert table lock

Posted by lihnid on Stack Overflow See other posts from Stack Overflow or by lihnid
Published on 2010-04-29T21:34:17Z Indexed on 2010/04/29 21:37 UTC
Read the original article Hit count: 427

Filed under:
|

Hi All,

I have two services talking to two different Data-stores (i.e SQL). I am using transactionscope: eg:

using(TransactionScope scope = new TransactionScope())
{
    service1.InsertUser(user);//Insert to SQL Service 1 table User
    service2.SavePayment(payment);//Save payment SQL Service 2 table payment
    scope.Complete();
}

Service1 is locking the table (User) until the transaction is completed making subsequent transactions with that table sequential. Is there a way to overcome the lock, so can have more than one concurrent calls to the SQL service1 table while the above code is executing?

I would appreciate any input.

Thanks in Advance.

Lihnid

© Stack Overflow or respective owner

Related posts about wcf

Related posts about transactionscope