70-513 · Question #164
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…
The correct answer is A. insert the following line at line 20. See the full explanation below for the reasoning.
Question
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.) 01 <ServiceContract()> 02 Public Interface IDatallpdate 04 <OperationContract()> 05 <TransactionFlow(TransactionFlowOption.Handatocy)> 06 Sub Update (ByVal accountNumber As String, ByVal amount As Double) 08 End Interface 10 Class UpdateService 11 Implements IDataUpdate 13 <OperationBehavior( TransactionScopeRequired:=True, TransactionAutoComplete:=True)> 14 Public Sub Update(ByVal accountNumber As String, ByVal amount As Double) Implements IDataUpdate.Update IS 16 Try 18 Catch ex As Exception 19 WriteErrorLog(ex) 20 21 End Try 23 End Sub 25 End Class 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?
Options
- Ainsert the following line at line 20.
- BReplace line 13 with the following line.
- CInsert the following line at line 09.
- DInsert the following line at line 09.
How the community answered
(35 responses)- A74% (26)
- B9% (3)
- C14% (5)
- D3% (1)
Community Discussion
No community discussion yet for this question.