Advice on AOP, Method Interception and Transaction

Jan 7, 2009 at 4:23 PM
Hi there

I have a doubt
 Suppose you have a Business Layer and an application layer. 
 In the app layer we have a business process that involves2 or more methods in the business layer and i want to intercept the methods to initiate a transaction on the first an commit the transaction in the last method. Is this possible or there is another way? Injection maybe?
Jan 8, 2009 at 1:39 AM
Edited Jan 8, 2009 at 3:09 AM
there are a lot more people here who know a lot more about what you asked for. But i'll try to give you some pointers outside the Unity framework and hopefully others will give you enough pointers on how Unity can help you.
1. This is the simplest way of doing this. In your app code, start a transaction, call biz proc1, call biz proc 2 and then commit the transaction. You can use TransactionScope or any other method.
2. Make your biz objects EnterpriseComponents and run them in COM+ container. You can then tag your method with attributes and let the container worry about the rest.
3. You can use Unity Interception or Injection to wrap or inject a transaction for each proc. Others will be able to help you more on this