You need to ensure that the transaction is aborted if the Update method is not successful

You are developing a Windows Communication Foundation (WCF) service that allows
customers to update financial data. The client applications call the service in a transaction.
The service contract is defined as follows. (Line numbers are included for reference only.)
Customers report that the transaction completes successfully even if the Update method
throws an exception. You need to ensure that the transaction is aborted if the Update
method is not successful. What should you do?

You are developing a Windows Communication Foundation (WCF) service that allows
customers to update financial data. The client applications call the service in a transaction.
The service contract is defined as follows. (Line numbers are included for reference only.)
Customers report that the transaction completes successfully even if the Update method
throws an exception. You need to ensure that the transaction is aborted if the Update
method is not successful. What should you do?

A.
Replace line 12 with the following line. [OperationBehavior( TransactionScopeRequired =
true, TransactionAutoCoroplete – false)]

B.
Insert the following line at line 09. [ServiceBehavior(
TransactionAutoCompleteOnSessionClose = true)]

C.
insert the following line at line 22. throw;

D.
Insert the following line at line 09. [ServiceBehavior(
TransactionAutoCompleteOnSessionClose = false)]

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *