You work as an Application Developer for PassGuide.com. You are tasked with creating a WCF
application for a bank. You write the following code segment: (Line numbers are for reference
only.)
01 [ServiceContract]
02 public interface IBankService
03 {
04 [OperationContract]
05 void WithdrawFunds();
06{
07
08 public class ServiceImpl : IBankService
09 {
10 [OperationBehavior(TransactionScopeRequired=true)]
11 public void WithdrawFunds() { }
12 }
You need to ensure that each service call is allowed on the service instance at a time and the
service object is released as soon as the current transaction is completed. Which of the following
code segments should you insert at line number 07?
A.
[ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple,
ReleaseServiceInstanceOnTransactionComplete=true)]
B.
[ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant,
ReleaseServiceInstanceOnTransactionComplete=false)]
C.
[ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple,
ReleaseServiceInstanceOnTransactionComplete=false)]
D.
[ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single,
ReleaseServiceInstanceOnTransactionComplete=true)]
Explanation: