Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/17/13 10:51:42 (10 years ago)
Author:
pfleck
Message:

#2030:
Updated license year in headers and AssemblyInfo.
Removed empty regions in OptimizedHiveDao and IOptimizedHiveDao.
The ServiceLocator handles creation of the OptimizedHiveDao different to make the OptimizedHiveDao available for non-service operation calls:

  • if the ServiceLocator is called _within_ a service operation, the same DB-context is used for the whole service operation, and therefore is stored in the service operation context.
  • if the ServiceLocator is called _outside_ a service operation, a new DB-context is created on each ServiceLocator call.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HivePerformance/sources/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs

    r9539 r9634  
    4242    }
    4343
    44     private IOptimizedHiveDao optimizedHiveDao;
    4544    public IOptimizedHiveDao OptimizedHiveDao {
    4645      get {
    47         if (optimizedHiveDao == null) optimizedHiveDao = new OptimizedHiveDao();
    48         return optimizedHiveDao;
     46        var dataContext = HiveOperationContext.Current != null
     47                            ? HiveOperationContext.Current.DataContext
     48                            : new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
     49        return new OptimizedHiveDao(dataContext);
    4950      }
    5051    }
Note: See TracChangeset for help on using the changeset viewer.