Last post Mar 08, 2013 06:28 AM by sukumarraju
Feb 06, 2013 06:47 AM|atiliosud|LINK
I want to known which one (s) would be the best solution in this scenario.
1) Invoke the Service 1 that invoke business rules BLL, which will then access the DAL layer to perform CRUD operations.
2) Shortly thereafter, the service 2 will be invoked , which will also make access to BLL and then access the DAL for CRUD.
If an exception occurs in the execution of the operation of the Service 2 for example.
Can I implement so that everything that was done before will be undone, including operations of the service 1 ?
Any sugestions ?
Mar 08, 2013 06:28 AM|sukumarraju|LINK
Here is an example
//1. Add TransactionFlow attribute to Service operations
public interface IService1
//2. Add TransactionScopeRequired attribute to Service operation implementation
[OperationBehavior(TransactionScopeRequired = true)]
public void UpdateData()
//3.Enable transactionFlow for bindings in config
<binding name="TransactionalBind" transactionFlow="true"/>
//4. Attach binding to the end point
<endpoint address="" binding="wsHttpBinding"
//5. Call the both services under Transaction scope
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew))
ServiceReference1.Service1Client obj = new ServiceReference1.Service1Client();
ServiceReference2.Service1Client obj1 = new ServiceReference2.Service1Client();
catch (Exception ex)