Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server/3.2/ServiceCallInterception.cs @ 3188

Last change on this file since 3188 was 3013, checked in by kgrading, 15 years ago

fixed HiveBridge and removed compile errors (#830)

File size: 1.2 KB
RevLine 
[2904]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using AopAlliance.Intercept;
6using System.Threading;
[3011]7using HeuristicLab.Hive.Server.LINQDataAccess;
8using System.Transactions;
[2904]9
10namespace HeuristicLab.Hive.Server {
11  class ServiceCallInterception: IMethodInterceptor {
12    #region IMethodInterceptor Members
13
14    public object Invoke(IMethodInvocation invocation) {
15      Console.WriteLine(DateTime.Now + " - " + Thread.CurrentThread.ManagedThreadId + " - Entering Method " + invocation.Method.Name);
[3011]16
17      Object obj;
18     
[3013]19     // using (TransactionScope scope = new TransactionScope()) {
[3011]20        try {
21          obj = invocation.Proceed();
[3013]22     //     scope.Complete();
[3011]23        } finally {
24          ContextFactory.Context.Dispose();
25          Console.WriteLine("setting old context null");
26          ContextFactory.Context = null;
27          Console.WriteLine("Disposing old Context");     
28        }
[3013]29     // }     
[3011]30      Console.WriteLine(DateTime.Now + " - " + Thread.CurrentThread.ManagedThreadId + " - Leaving Method " + invocation.Method.Name);           
[2904]31      return obj;
32    }
33
34    #endregion
35  }
36}
Note: See TracBrowser for help on using the repository browser.