Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/13 13:47:27 (11 years ago)
Author:
pfleck
Message:

#2030
Added SelfHost-Project
Renamed HiveDtoDao back to HiveDao and renamed the optimized HiveDao into OptimizedDao instead.
Optimized AddTask by using compiled queries.

File:
1 edited

Legend:

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

    r9393 r9434  
    2222using System;
    2323using System.Collections.ObjectModel;
    24 using System.Diagnostics;
    25 using System.IO;
    2624using System.ServiceModel;
    2725using System.ServiceModel.Channels;
    2826using System.ServiceModel.Description;
    2927using System.ServiceModel.Dispatcher;
    30 using System.Text;
    3128using HeuristicLab.Services.Hive.DataAccess;
    3229
    3330namespace HeuristicLab.Services.Hive {
    3431  public class HiveOperationContext : IExtension<OperationContext> {
     32
    3533    public static HiveOperationContext Current {
    3634      get {
     
    4240    public HiveDataContext DataContext {
    4341      get {
    44         if (dataContext == null) {
    45           dataContext = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
    46           //dataContext.Log = new DebugWriter();
    47         }
    48         return dataContext;
     42        return dataContext ?? (dataContext = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString));
    4943      }
    5044    }
     
    6761    }
    6862
    69     public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, object correlationState) {
     63    public void BeforeSendReply(ref Message reply, object correlationState) {
    7064      OperationContext.Current.Extensions.Remove(HiveOperationContext.Current);
    7165    }
     
    8882    }
    8983  }
    90 
    91   internal class DebugWriter : TextWriter {
    92     public override Encoding Encoding {
    93       get { return Encoding.UTF8; }
    94     }
    95 
    96     public override void Write(char value) {
    97       Debug.Write(value);
    98     }
    99 
    100     public override void Write(string value) {
    101       Debug.Write(value);
    102     }
    103 
    104     public override void WriteLine(string value) {
    105       Debug.WriteLine(value);
    106     }
    107   }
    10884}
Note: See TracChangeset for help on using the changeset viewer.