Testing the transaction behavior of the WCF service
Before explaining how to enhance this WCF service to support distributed transactions, we will first confirm that the existing WCF service doesn't support distributed transactions. In this section, we will test the following scenarios:
Create a WPF client to call the service twice in one method.
The first service call should succeed and the second service call should fail.
Verify that the update in the first service call has been committed to the database, which means that the WCF service does not support distributed transactions.
Wrap the two service calls in one
TransactionScope
and redo the test.Verify that the update in the first service call has still been committed to the database which means the WCF service does not support distributed transactions even if both service calls are within one transaction scope.
Add a second database support to the WCF service.
Modify the client to update both databases in one method.
The first update should...