Impact of SQL transaction in WCF transaction

I call the wcf service, and its purpose is to insert some details into the sql server table. I use sql transactions and after the insert operation I also commit the SQL server transaction. Now this service is called by the client who initiated his transaction and inside his transaction, calling this service. Therefore my request: -

If the transaction is performed by a SQL server transaction transaction and some exception occurs on the client side after calling another service (this service functionality is successful, but the client calls one other wcf service that throws an exception), so the inserted data will be rolled back on the basis of the 1st service or not, and if so, how will it happen.

+4
source share
2 answers

This example applies to your question: Tansactions in WCF

The client has a client that invokes two WCF transactions in a transaction. Each service itself issues a transaction to the database. The example checks the case when the call to the first server ends, but then an exception is thrown - the data from the first call is not written to db, because the client transaction is rolled back due to an exception after the first server call.

, , , , ! ( , , , !), , , , WCF- [OperationBehavior(TransactionScopeRequired = true)], WCF - db - ( , - ) - , / .

insite, - , db, , , , , , .

: , TransactionScope .

+2

SQL , , WCF, , . .

+1

All Articles