单项选择题
You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache for many Web applications.The service contract is defined as follows. (Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IDataCache
03 {
04 ...
05 }06
07
08 public class DataCache : IDataCache
09 {
10 ...
11 }
You need to ensure that all users share the cache.
Which code segment should you insert at line 07?()
A. [ServiceBehavior(TransactionIsolationLevel = IsolationLevel.RepeatableRead)]
B. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
C. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
D. [ServiceBehavior(TransactionIsolationLevel = IsolationLevel.ReadComitted)]
相关考题
-
单项选择题
You are developing a Windows Service. The Windows Service will host a Windows Communication Foundation (WCF) service.The Windows Service class will inherit from ServiceBase.You need to ensure that the WCF service starts when the Windows Service is restarted. What should you do in the Windows Service class?()
A.
B.
C.
D. -
单项选择题
You are developing a Windows Communication Foundation (WCF) service that executes a long-running operation.The service is accessed from your business applications in a server transaction in which the client does not participate.You need to ensure that the transaction times out and aborts if the operation has not completed within 45 seconds. What should you do?()
A. Set the service binding sendTimeout attribute to 00:00:45.
B. Apply [ServiceBehavior(TransactionTimeout="00:00:45")] to the service implementation.
C. Set the service binding receiveTimeout attribute to 00:00:45.
D. Apply [OperationBehavior(TransactionScopeRequired=false)] to the service operation. -
单项选择题
A Windows Communication Foundation (WCF) service is deployed with netTcpBinding. This service uses a duplex message exchange pattern.You are developing the next version of the WCF service. You discover that your companys hardware load balancer performs correctly only for WCF services that use HTTP. You need to ensure that your service works with the load balancer. What should you do?()
A. Use basicHttpBinding.
B. Create a custom binding that has the compositeDuplex, textMessageEncoding, and namedPipeTransport binding elements in this order.
C. Create a custom binding that has the compositeDuplex, textMessageEncoding, and wsHttpTransport binding elements in this order.
D. Use wsHttpBinding.
