News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
[ServiceContract]
public class ContosoService
{
[OperationContract]
[TransactionFlow(TransactionFlowOption.Mandatory)]
[OperationBehavior(TransactionScopeRequired=true,TransactionAutoComplete=false)]
void TxOp 1 (string value) {... };
[OperationContract(IsTerminating=true)]
[TransactionFlow(TransactionFlowOption.Mandatory)]
[OperationBehavior(TransactionScopeRequired=true,TransactionAutoComplete=false)]
void TxOp2(string value)
{
...
OperationContext.Current.SetTransactionComplete();
}
}

The service and the clients that call the service use NetTcpBinding with transaction flow enabled. You need to configure the service so that when TxOp1 and TxOp2 are invoked under the same client session, they run under the same transaction context. What should you do?

  1. Update the service contract to read as follows.

    [ServiceContract(SessionMode=SessionMode.Required)]

    Add the following behavior to the service implementation

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)]
  2. Update the service contract to read as follows.

    [ServiceContract(SessionMode=SessionMode.Allowed)]

    Add the following behavior to the service implementation.

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single, ReleaseServiceInstanceOnTransactionComplete=false)]
  3. Update the service contract to read as follows

    [ServiceContract(SessionMode=SessionMode.Allowed)]

    Add the followng behavior to the service implementation.

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
  4. Update the service contract to read as follows.

    [ServiceContract(SessionMode=SessionMode.Required)]

    Add the following behavior to the service implementation.

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)]
Answer: Answer is a
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;