Which method implementation should you use?

You create a Windows Communication Foundation (WCF) service by using Microsoft .NET framework 3.5.
You write the following code segment for a service contract.

[ServiceContract]
public interface IOrderManager
{
[OperationContract]
void ProcessOrder(int ordered);
}

You need to ensure that the WCF service meets the following requirements:
The ProcessOrder method uses transactions.
The ProcessOrder method commits automatically if no exception occurs.
Which method implementation should you use?

You create a Windows Communication Foundation (WCF) service by using Microsoft .NET framework 3.5.
You write the following code segment for a service contract.

[ServiceContract]
public interface IOrderManager
{
[OperationContract]
void ProcessOrder(int ordered);
}

You need to ensure that the WCF service meets the following requirements:
The ProcessOrder method uses transactions.
The ProcessOrder method commits automatically if no exception occurs.
Which method implementation should you use?

A.
[TransactionFlow(TransactionFlowOption.NotAllowed)]
[OperationBehavior]
public void ProcessOrder(int orderId){}

B.
[OperationBehavior(TransactionScopeRequired=true,TransactionAutoComplete=true)]
public void ProcessOrder(int orderId){}

C.
[TransactionFlow(TransactionFlowOption.Allowed)]
[OperationBehavior(TransactionScopeRequired=false, TransactionAutoComplete=true)]
public void ProcessOrder(int orderId){}

D.
[TransactionFlow(TransactionFlowOption.Allowed)]
[OperationBehavior(ReleaseInstanceMode= ReleaseInstanceMode.AfterCall, TransactionScopeRequired=true, TransactionAutoComplete=false)]
public void ProcessOrder(int orderId){}



Leave a Reply 0

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