Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs	(revision 6701)
@@ -0,0 +1,363 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Data.Linq;
+using System.Linq;
+using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  public static class Convert {
+    #region Job
+    public static DT.Job ToDto(Job source) {
+      if (source == null) return null;
+      return new DT.Job {
+        Id = source.JobId,
+        CoresNeeded = source.CoresNeeded,
+        ExecutionTime = TimeSpan.FromMilliseconds(source.ExecutionTimeMs),
+        MemoryNeeded = source.MemoryNeeded,
+        ParentJobId = source.ParentJobId,
+        Priority = source.Priority,
+        PluginsNeededIds = (source.RequiredPlugins == null ? new List<Guid>() : source.RequiredPlugins.Select(x => x.PluginId).ToList()),
+        LastHeartbeat = source.LastHeartbeat,
+        State = source.State,
+        StateLog = (source.StateLogs == null ? new List<DT.StateLog>() : source.StateLogs.Select(x => Convert.ToDto(x)).OrderBy(x => x.DateTime).ToList()),
+        IsParentJob = source.IsParentJob,
+        FinishWhenChildJobsFinished = source.FinishWhenChildJobsFinished,
+        Command = source.Command,
+        LastJobDataUpdate = (source.JobData == null ? DateTime.MinValue : source.JobData.LastUpdate),
+        HiveExperimentId = source.HiveExperimentId,
+        IsPrivileged = source.IsPrivileged
+      };
+    }
+    public static Job ToEntity(DT.Job source) {
+      if (source == null) return null;
+      var entity = new Job(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Job source, Job target) {
+      if ((source != null) && (target != null)) {
+        target.JobId = source.Id;
+        target.CoresNeeded = source.CoresNeeded;
+        target.ExecutionTimeMs = source.ExecutionTime.TotalMilliseconds;
+        target.MemoryNeeded = source.MemoryNeeded;
+        target.ParentJobId = source.ParentJobId;
+        target.Priority = source.Priority;
+        target.LastHeartbeat = source.LastHeartbeat;
+        target.State = source.State;
+        if (target.StateLogs == null) target.StateLogs = new EntitySet<StateLog>();
+        foreach (DT.StateLog sl in source.StateLog.Where(x => x.Id == Guid.Empty)) {
+          target.StateLogs.Add(Convert.ToEntity(sl));
+        }
+        target.IsParentJob = source.IsParentJob;
+        target.FinishWhenChildJobsFinished = source.FinishWhenChildJobsFinished;
+        target.Command = source.Command;
+        // RequiredPlugins are added by Dao
+        target.HiveExperimentId = source.HiveExperimentId;
+        target.IsPrivileged = source.IsPrivileged;
+      }
+    }
+    #endregion
+
+    #region JobData
+    public static DT.JobData ToDto(JobData source) {
+      if (source == null) return null;
+      return new DT.JobData { JobId = source.JobId, Data = source.Data.ToArray(), LastUpdate = source.LastUpdate };
+    }
+    public static JobData ToEntity(DT.JobData source) {
+      if (source == null) return null;
+      var entity = new JobData(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.JobData source, JobData target) {
+      if ((source != null) && (target != null)) {
+        target.JobId = source.JobId; target.Data = new Binary(source.Data); target.LastUpdate = source.LastUpdate;
+      }
+    }
+    #endregion
+
+    #region StateLog
+    public static DT.StateLog ToDto(StateLog source) {
+      if (source == null) return null;
+      return new DT.StateLog { Id = source.StateLogId, DateTime = source.DateTime, Exception = source.Exception, JobId = source.JobId, SlaveId = source.SlaveId, State = source.State, UserId = source.UserId };
+    }
+    public static StateLog ToEntity(DT.StateLog source) {
+      if (source == null) return null;
+      var entity = new StateLog(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.StateLog source, StateLog target) {
+      if ((source != null) && (target != null)) {
+        target.StateLogId = source.Id; target.DateTime = source.DateTime; target.Exception = source.Exception; target.JobId = source.JobId; target.SlaveId = source.SlaveId; target.State = source.State; target.UserId = source.UserId;
+      }
+    }
+    #endregion
+
+    #region Downtimes
+    public static DT.Downtime ToDto(Downtime source) {
+      if (source == null) return null;
+      return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
+    }
+    public static Downtime ToEntity(DT.Downtime source) {
+      if (source == null) return null;
+      var entity = new Downtime(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Downtime source, Downtime target) {
+      if ((source != null) && (target != null)) {
+        target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate;
+      }
+    }
+    #endregion
+
+    #region HiveExperiment
+    public static DT.HiveExperiment ToDto(HiveExperiment source) {
+      if (source == null) return null;
+      return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, OwnerUserId = source.OwnerUserId, DateCreated = source.DateCreated, ResourceNames = source.ResourceIds, LastAccessed = source.LastAccessed };
+    }
+    public static HiveExperiment ToEntity(DT.HiveExperiment source) {
+      if (source == null) return null;
+      var entity = new HiveExperiment(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.HiveExperiment source, HiveExperiment target) {
+      if ((source != null) && (target != null)) {
+        target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.OwnerUserId = source.OwnerUserId; target.DateCreated = source.DateCreated; target.ResourceIds = source.ResourceNames; target.LastAccessed = source.LastAccessed;
+      }
+    }
+    #endregion
+
+    #region HiveExperimentPermission
+    public static DT.HiveExperimentPermission ToDto(HiveExperimentPermission source) {
+      if (source == null) return null;
+      return new DT.HiveExperimentPermission { HiveExperimentId = source.HiveExperimentId, GrantedUserId = source.GrantedUserId, GrantedByUserId = source.GrantedByUserId, Permission = source.Permission };
+    }
+    public static HiveExperimentPermission ToEntity(DT.HiveExperimentPermission source) {
+      if (source == null) return null;
+      var entity = new HiveExperimentPermission(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.HiveExperimentPermission source, HiveExperimentPermission target) {
+      if ((source != null) && (target != null)) {
+        target.HiveExperimentId = source.HiveExperimentId; target.GrantedUserId = source.GrantedUserId; target.GrantedByUserId = source.GrantedByUserId; target.Permission = source.Permission;
+      }
+    }
+    #endregion
+
+    #region Plugin
+    public static DT.Plugin ToDto(Plugin source) {
+      if (source == null) return null;
+      return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version), UserId = source.UserId, DateCreated = source.DateCreated, Hash = source.Hash };
+    }
+    public static Plugin ToEntity(DT.Plugin source) {
+      if (source == null) return null;
+      var entity = new Plugin(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Plugin source, Plugin target) {
+      if ((source != null) && (target != null)) {
+        target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); target.UserId = source.UserId; target.DateCreated = source.DateCreated; target.Hash = source.Hash;
+      }
+    }
+    #endregion
+
+    #region PluginData
+    public static DT.PluginData ToDto(PluginData source) {
+      if (source == null) return null;
+      return new DT.PluginData { Id = source.PluginDataId, PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName };
+    }
+    public static PluginData ToEntity(DT.PluginData source) {
+      if (source == null) return null;
+      var entity = new PluginData(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.PluginData source, PluginData target) {
+      if ((source != null) && (target != null)) {
+        target.PluginDataId = source.Id; target.PluginId = source.PluginId; target.Data = new Binary(source.Data); target.FileName = source.FileName;
+      }
+    }
+    #endregion
+
+    #region Slave
+    public static DT.Slave ToDto(Slave source) {
+      if (source == null) return null;
+      return new DT.Slave {
+        Id = source.ResourceId,
+        ParentResourceId = source.ParentResourceId,
+        Cores = source.Cores,
+        CpuSpeed = source.CpuSpeed,
+        FreeCores = source.FreeCores,
+        FreeMemory = source.FreeMemory,
+        IsAllowedToCalculate = source.IsAllowedToCalculate,
+        Memory = source.Memory,
+        Name = source.Name,
+        SlaveState = source.SlaveState,
+        CpuArchitecture = source.CpuArchitecture,
+        OperatingSystem = source.OperatingSystem,
+        LastHeartbeat = source.LastHeartbeat,
+        CpuUtilization = source.CpuUtilization
+      };
+    }
+    public static Slave ToEntity(DT.Slave source) {
+      if (source == null) return null;
+      var entity = new Slave(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Slave source, Slave target) {
+      if ((source != null) && (target != null)) {
+        target.ResourceId = source.Id;
+        target.ParentResourceId = source.ParentResourceId;
+        target.Cores = source.Cores;
+        target.CpuSpeed = source.CpuSpeed;
+        target.FreeCores = source.FreeCores;
+        target.FreeMemory = source.FreeMemory;
+        target.IsAllowedToCalculate = source.IsAllowedToCalculate;
+        target.Memory = source.Memory;
+        target.Name = source.Name;
+        target.SlaveState = source.SlaveState;
+        target.CpuArchitecture = source.CpuArchitecture;
+        target.OperatingSystem = source.OperatingSystem;
+        target.LastHeartbeat = source.LastHeartbeat;
+        target.CpuUtilization = source.CpuUtilization;
+      }
+    }
+    #endregion
+
+    #region SlaveGroup
+    public static DT.SlaveGroup ToDto(SlaveGroup source) {
+      if (source == null) return null;
+      return new DT.SlaveGroup { Id = source.ResourceId, Name = source.Name, ParentResourceId = source.ParentResourceId };
+    }
+    public static SlaveGroup ToEntity(DT.SlaveGroup source) {
+      if (source == null) return null;
+      var entity = new SlaveGroup(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.SlaveGroup source, SlaveGroup target) {
+      if ((source != null) && (target != null)) {
+        target.ResourceId = source.Id; target.Name = source.Name; target.ParentResourceId = source.ParentResourceId;
+      }
+    }
+    #endregion
+
+    #region Resource
+    public static DT.Resource ToDto(Resource source) {
+      if (source == null) return null;
+      return new DT.Resource { Id = source.ResourceId, Name = source.Name, ParentResourceId = source.ParentResourceId };
+    }
+    public static Resource ToEntity(DT.Resource source) {
+      if (source == null) return null;
+      var entity = new Resource(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Resource source, Resource target) {
+      if ((source != null) && (target != null)) {
+        target.ResourceId = source.Id; target.Name = source.Name; target.ParentResourceId = source.ParentResourceId;
+      }
+    }
+    #endregion
+
+    #region Statistics
+    public static DT.Statistics ToDto(Statistics source) {
+      if (source == null) return null;
+      return new DT.Statistics {
+        Id = source.StatisticsId,
+        TimeStamp = source.Timestamp,
+        SlaveStatistics = source.SlaveStatistics.Select(x => Convert.ToDto(x)).ToArray(),
+        UserStatistics = source.UserStatistics.Select(x => Convert.ToDto(x)).ToArray()
+      };
+    }
+    public static Statistics ToEntity(DT.Statistics source) {
+      if (source == null) return null;
+      var entity = new Statistics(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Statistics source, Statistics target) {
+      if ((source != null) && (target != null)) {
+        target.StatisticsId = source.Id;
+        target.Timestamp = source.TimeStamp;
+
+      }
+    }
+    #endregion
+
+    #region SlaveStatistics
+    public static DT.SlaveStatistics ToDto(SlaveStatistics source) {
+      if (source == null) return null;
+      return new DT.SlaveStatistics {
+        Id = source.StatisticsId,
+        SlaveId = source.SlaveId,
+        Cores = source.Cores,
+        CpuUtilization = source.CpuUtilization,
+        FreeCores = source.FreeCores,
+        FreeMemory = source.FreeMemory,
+        Memory = source.Memory
+      };
+    }
+    public static SlaveStatistics ToEntity(DT.SlaveStatistics source) {
+      if (source == null) return null;
+      var entity = new SlaveStatistics(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.SlaveStatistics source, SlaveStatistics target) {
+      if ((source != null) && (target != null)) {
+        target.StatisticsId = source.Id;
+        target.SlaveId = source.SlaveId;
+        target.Cores = source.Cores;
+        target.CpuUtilization = source.CpuUtilization;
+        target.FreeCores = source.FreeCores;
+        target.FreeMemory = source.FreeMemory;
+        target.Memory = source.Memory;
+      }
+    }
+    #endregion
+
+    #region UserStatistics
+    public static DT.UserStatistics ToDto(UserStatistics source) {
+      if (source == null) return null;
+      return new DT.UserStatistics {
+        Id = source.StatisticsId,
+        UserId = source.UserId,
+        UsedCores = source.UsedCores,
+        ExecutionTime = TimeSpan.FromMilliseconds(source.ExecutionTimeMs),
+        ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(source.ExecutionTimeMsFinishedJobs),
+        StartToEndTime = TimeSpan.FromMilliseconds(source.StartToEndTimeMs)
+      };
+    }
+    public static UserStatistics ToEntity(DT.UserStatistics source) {
+      if (source == null) return null;
+      var entity = new UserStatistics(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.UserStatistics source, UserStatistics target) {
+      if ((source != null) && (target != null)) {
+        target.StatisticsId = source.Id;
+        target.UserId = source.UserId;
+        target.UsedCores = source.UsedCores;
+        target.ExecutionTimeMs = source.ExecutionTime.TotalMilliseconds;
+        target.ExecutionTimeMsFinishedJobs = source.ExecutionTimeFinishedJobs.TotalMilliseconds;
+        target.StartToEndTimeMs = source.StartToEndTime.TotalMilliseconds;
+      }
+    }
+    #endregion
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Exceptions/DaoException.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Exceptions/DaoException.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Exceptions/DaoException.cs	(revision 6701)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  public class DaoException : Exception {
+    public DaoException(string message) : base(message) { }
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 6701)
@@ -0,0 +1,175 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Services.Hive.DataAccess</RootNamespace>
+    <AssemblyName>HeuristicLab.Services.Hive.DataAccess-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Services.Hive.DataAccess-3.4.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\HeuristicLab.Services.Hive.DataAccess-3.4.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.Linq" />
+    <Reference Include="System.Transactions" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Convert.cs" />
+    <None Include="HeuristicLabServicesHiveDataAccessPlugin.cs.frame" />
+    <Compile Include="HeuristicLabServicesHiveDataAccessPlugin.cs" />
+    <Compile Include="HiveDao.cs" />
+    <Compile Include="HiveDataContext.cs">
+      <DependentUpon>HiveDataContext.dbml</DependentUpon>
+    </Compile>
+    <Compile Include="HiveDataContext.designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>HiveDataContext.dbml</DependentUpon>
+    </Compile>
+    <Compile Include="Interfaces\IHiveDao.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+    <Compile Include="TransactionManager.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config">
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HiveDataContext.dbml">
+      <Generator>MSLinqToSQLGenerator</Generator>
+      <LastGenOutput>HiveDataContext.designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HiveDataContext.dbml.layout">
+      <DependentUpon>HiveDataContext.dbml</DependentUpon>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Services.Hive.Common\3.3\HeuristicLab.Services.Hive.Common-3.3.csproj">
+      <Project>{14424A16-48D4-445E-80BF-DDF617548BBB}</Project>
+      <Name>HeuristicLab.Services.Hive.Common-3.4</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="SQL Scripts\Query Daily Statistics.sql" />
+    <Content Include="SQL Scripts\Query Statistics.sql" />
+    <Content Include="SQL Scripts\Query Jobs.sql" />
+    <Content Include="SQL Scripts\Initialize Hive Database.sql" />
+    <Content Include="SQL Scripts\Prepare Hive Database.sql" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>set ProjectName=$(ProjectName)
+set TargetPath=$(TargetPath)
+call $(SolutionDir)/CopyAssembly.cmd</PostBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLabServicesHiveDataAccessPlugin.cs.frame
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLabServicesHiveDataAccessPlugin.cs.frame	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLabServicesHiveDataAccessPlugin.cs.frame	(revision 6701)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  [Plugin("HeuristicLab.Services.Hive.DataAccess", "3.3.5.$WCREV$")]
+  [PluginFile("HeuristicLab.Services.Hive.DataAccess-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Services.Hive.Common", "3.3")]
+  public class HeuristicLabServicesHiveDataAccessPlugin : PluginBase {
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs	(revision 6701)
@@ -0,0 +1,830 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using HeuristicLab.Services.Hive.Common.DataTransfer;
+using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  public class HiveDao : IHiveDao {
+    public static HiveDataContext CreateContext(bool longRunning = false) {
+      var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
+      if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;
+      return context;
+    }
+
+    public HiveDao() { }
+
+    #region Job Methods
+    public DT.Job GetJob(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Jobs.SingleOrDefault(x => x.JobId == id));
+      }
+    }
+
+    public IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Jobs.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddJob(DT.Job dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Jobs.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        foreach (Guid pluginId in dto.PluginsNeededIds) {
+          db.RequiredPlugins.InsertOnSubmit(new RequiredPlugin() { JobId = entity.JobId, PluginId = pluginId });
+        }
+        db.SubmitChanges();
+        return entity.JobId;
+      }
+    }
+
+    public void UpdateJob(DT.Job dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Jobs.FirstOrDefault(x => x.JobId == dto.Id);
+        if (entity == null) db.Jobs.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        foreach (Guid pluginId in dto.PluginsNeededIds) {
+          if (db.RequiredPlugins.Count(p => p.PluginId == pluginId) == 0) {
+            db.RequiredPlugins.InsertOnSubmit(new RequiredPlugin() { JobId = entity.JobId, PluginId = pluginId });
+          }
+        }
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteJob(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Jobs.FirstOrDefault(x => x.JobId == id);
+        if (entity != null) db.Jobs.DeleteOnSubmit(entity);
+        db.SubmitChanges(); // JobData and child jobs are deleted by db-trigger
+      }
+    }
+
+    /// <summary>
+    /// returns all parent jobs which are waiting for their child jobs to finish
+    /// </summary>
+    /// <param name="resourceIds">list of resourceids which for which the jobs should be valid</param>
+    /// <param name="count">maximum number of jobs to return</param>
+    /// <param name="finished">if true, all parent jobs which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
+    /// <returns></returns>
+    public IEnumerable<DT.Job> GetParentJobs(IEnumerable<Guid> resourceIds, int count, bool finished) {
+      using (var db = CreateContext()) {
+        var query = from ar in db.AssignedResources
+                    where resourceIds.Contains(ar.ResourceId)
+                       && ar.Job.State == JobState.Waiting
+                       && ar.Job.IsParentJob
+                       && (finished ? ar.Job.FinishWhenChildJobsFinished : !ar.Job.FinishWhenChildJobsFinished)
+                       && (from child in db.Jobs
+                           where child.ParentJobId == ar.Job.JobId
+                           select child.State == JobState.Finished
+                               || child.State == JobState.Aborted
+                               || child.State == JobState.Failed).All(x => x)
+                       && (from child in db.Jobs // avoid returning WaitForChildJobs jobs where no child-jobs exist (yet)
+                           where child.ParentJobId == ar.Job.JobId
+                           select child).Count() > 0
+                    orderby ar.Job.Priority descending, db.Random()
+                    select Convert.ToDto(ar.Job);
+        return count == 0 ? query.ToArray() : query.Take(count).ToArray();
+      }
+    }
+
+    public IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave, int count) {
+      using (var db = CreateContext()) {
+        var resourceIds = GetParentResources(slave.Id).Select(r => r.Id);
+        var waitingParentJobs = GetParentJobs(resourceIds, count, false);
+        if (count > 0 && waitingParentJobs.Count() >= count) return waitingParentJobs.Take(count).ToArray();
+
+        var query = from ar in db.AssignedResources
+                    where resourceIds.Contains(ar.ResourceId)
+                       && !(ar.Job.IsParentJob && ar.Job.FinishWhenChildJobsFinished)
+                       && ar.Job.State == JobState.Waiting
+                       && ar.Job.CoresNeeded <= slave.FreeCores
+                       && ar.Job.MemoryNeeded <= slave.FreeMemory
+                    orderby ar.Job.Priority descending, db.Random() // take random job to avoid the race condition that occurs when this method is called concurrently (the same job would be returned)
+                    select Convert.ToDto(ar.Job);
+        var waitingJobs = (count == 0 ? query : query.Take(count)).ToArray();
+        return waitingJobs.Union(waitingParentJobs).OrderByDescending(x => x.Priority);
+      }
+    }
+
+    public DT.Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception) {
+      using (var db = CreateContext()) {
+        var job = db.Jobs.SingleOrDefault(x => x.JobId == jobId);
+        job.State = jobState;
+        db.StateLogs.InsertOnSubmit(new StateLog {
+          JobId = jobId,
+          State = jobState,
+          SlaveId = slaveId,
+          UserId = userId,
+          Exception = exception,
+          DateTime = DateTime.Now
+        });
+        db.SubmitChanges();
+        job = db.Jobs.SingleOrDefault(x => x.JobId == jobId);
+        return Convert.ToDto(job);
+      }
+    }
+    #endregion
+
+    #region JobData Methods
+    public DT.JobData GetJobData(Guid id) {
+      using (var db = CreateContext(true)) {
+        return Convert.ToDto(db.JobDatas.SingleOrDefault(x => x.JobId == id));
+      }
+    }
+
+    public IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate) {
+      using (var db = CreateContext(true)) {
+        return db.JobDatas.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddJobData(DT.JobData dto) {
+      using (var db = CreateContext(true)) {
+        var entity = Convert.ToEntity(dto);
+        db.JobDatas.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.JobId;
+      }
+    }
+
+    public void UpdateJobData(DT.JobData dto) {
+      using (var db = CreateContext(true)) {
+        var entity = db.JobDatas.FirstOrDefault(x => x.JobId == dto.JobId);
+        if (entity == null) db.JobDatas.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteJobData(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.JobDatas.FirstOrDefault(x => x.JobId == id); // check if all the byte[] is loaded into memory here. otherwise work around to delete without loading it
+        if (entity != null) db.JobDatas.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region StateLog Methods
+    public DT.StateLog GetStateLog(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.StateLogs.SingleOrDefault(x => x.StateLogId == id));
+      }
+    }
+
+    public IEnumerable<DT.StateLog> GetStateLogs(Expression<Func<StateLog, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.StateLogs.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddStateLog(DT.StateLog dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.StateLogs.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.StateLogId;
+      }
+    }
+
+    public void UpdateStateLog(DT.StateLog dto) {
+      using (var db = CreateContext()) {
+        var entity = db.StateLogs.FirstOrDefault(x => x.StateLogId == dto.Id);
+        if (entity == null) db.StateLogs.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteStateLog(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.StateLogs.FirstOrDefault(x => x.StateLogId == id);
+        if (entity != null) db.StateLogs.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region HiveExperiment Methods
+    public DT.HiveExperiment GetHiveExperiment(Guid id) {
+      using (var db = CreateContext()) {
+        return AddStatsToExperiment(db, Convert.ToDto(db.HiveExperiments.SingleOrDefault(x => x.HiveExperimentId == id)));
+      }
+    }
+
+    private DT.HiveExperiment AddStatsToExperiment(HiveDataContext db, DT.HiveExperiment exp) {
+      if (exp == null)
+        return null;
+
+      var jobs = db.Jobs.Where(j => j.HiveExperimentId == exp.Id);
+      exp.JobCount = jobs.Count();
+      exp.CalculatingCount = jobs.Count(j => j.State == JobState.Calculating);
+      exp.FinishedCount = jobs.Count(j => j.State == JobState.Finished);
+      return exp;
+    }
+
+    public IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.HiveExperiments.Where(predicate).Select(x => AddStatsToExperiment(db, Convert.ToDto(x))).ToArray();
+      }
+    }
+
+    public Guid AddHiveExperiment(DT.HiveExperiment dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.HiveExperiments.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.HiveExperimentId;
+      }
+    }
+
+    public void UpdateHiveExperiment(DT.HiveExperiment dto) {
+      using (var db = CreateContext()) {
+        var entity = db.HiveExperiments.FirstOrDefault(x => x.HiveExperimentId == dto.Id);
+        if (entity == null) db.HiveExperiments.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteHiveExperiment(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.HiveExperiments.FirstOrDefault(x => x.HiveExperimentId == id);
+        if (entity != null) db.HiveExperiments.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region HiveExperimentPermission Methods
+    public DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.HiveExperimentPermissions.SingleOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId));
+      }
+    }
+
+    public IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.HiveExperimentPermissions.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public void AddHiveExperimentPermission(DT.HiveExperimentPermission dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.HiveExperimentPermissions.InsertOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto) {
+      using (var db = CreateContext()) {
+        var entity = db.HiveExperimentPermissions.FirstOrDefault(x => x.HiveExperimentId == dto.HiveExperimentId && x.GrantedUserId == dto.GrantedUserId);
+        if (entity == null) db.HiveExperimentPermissions.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId) {
+      using (var db = CreateContext()) {
+        var entity = db.HiveExperimentPermissions.FirstOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId);
+        if (entity != null) db.HiveExperimentPermissions.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+
+    /// <summary>
+    /// Sets the permissions for a experiment. makes sure that only one permission per user exists.
+    /// </summary>
+    public void SetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedByUserId, Guid grantedUserId, Permission permission) {
+      using (var db = CreateContext()) {
+        HiveExperimentPermission hiveExperimentPermission = db.HiveExperimentPermissions.SingleOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId);
+        if (hiveExperimentPermission != null) {
+          if (permission == Permission.NotAllowed) {
+            // not allowed, delete
+            db.HiveExperimentPermissions.DeleteOnSubmit(hiveExperimentPermission);
+          } else {
+            // update
+            hiveExperimentPermission.Permission = permission;
+            hiveExperimentPermission.GrantedByUserId = grantedByUserId; // update grantedByUserId, always the last "granter" is stored
+          }
+        } else {
+          // insert
+          if (permission != Permission.NotAllowed) {
+            hiveExperimentPermission = new HiveExperimentPermission() { HiveExperimentId = hiveExperimentId, GrantedByUserId = grantedByUserId, GrantedUserId = grantedUserId, Permission = permission };
+            db.HiveExperimentPermissions.InsertOnSubmit(hiveExperimentPermission);
+          }
+        }
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region Plugin Methods
+    public DT.Plugin GetPlugin(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Plugins.SingleOrDefault(x => x.PluginId == id));
+      }
+    }
+
+    public IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Plugins.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddPlugin(DT.Plugin dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Plugins.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.PluginId;
+      }
+    }
+
+    public void UpdatePlugin(DT.Plugin dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Plugins.FirstOrDefault(x => x.PluginId == dto.Id);
+        if (entity == null) db.Plugins.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeletePlugin(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Plugins.FirstOrDefault(x => x.PluginId == id);
+        if (entity != null) db.Plugins.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region PluginData Methods
+    public DT.PluginData GetPluginData(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.PluginDatas.SingleOrDefault(x => x.PluginDataId == id));
+      }
+    }
+
+    public IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.PluginDatas.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddPluginData(DT.PluginData dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.PluginDatas.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.PluginDataId;
+      }
+    }
+
+    public void UpdatePluginData(DT.PluginData dto) {
+      using (var db = CreateContext()) {
+        var entity = db.PluginDatas.FirstOrDefault(x => x.PluginId == dto.PluginId);
+        if (entity == null) db.PluginDatas.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeletePluginData(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.PluginDatas.FirstOrDefault(x => x.PluginDataId == id);
+        if (entity != null) db.PluginDatas.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region Slave Methods
+    public DT.Slave GetSlave(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Resources.OfType<Slave>().SingleOrDefault(x => x.ResourceId == id));
+      }
+    }
+
+    public IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Resources.OfType<Slave>().Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddSlave(DT.Slave dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Resources.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.ResourceId;
+      }
+    }
+
+    public void UpdateSlave(DT.Slave dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Resources.OfType<Slave>().FirstOrDefault(x => x.ResourceId == dto.Id);
+        if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteSlave(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Resources.OfType<Slave>().FirstOrDefault(x => x.ResourceId == id);
+        if (entity != null) db.Resources.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region SlaveGroup Methods
+    public DT.SlaveGroup GetSlaveGroup(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Resources.OfType<SlaveGroup>().SingleOrDefault(x => x.ResourceId == id));
+      }
+    }
+
+    public IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Resources.OfType<SlaveGroup>().Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddSlaveGroup(DT.SlaveGroup dto) {
+      using (var db = CreateContext()) {
+        if (dto.Id == Guid.Empty)
+          dto.Id = Guid.NewGuid();
+        var entity = Convert.ToEntity(dto);
+        db.Resources.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.ResourceId;
+      }
+    }
+
+    public void UpdateSlaveGroup(DT.SlaveGroup dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Resources.OfType<SlaveGroup>().FirstOrDefault(x => x.ResourceId == dto.Id);
+        if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteSlaveGroup(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Resources.OfType<SlaveGroup>().FirstOrDefault(x => x.ResourceId == id);
+        if (entity != null) {
+          if (db.Resources.Where(r => r.ParentResourceId == id).Count() > 0) {
+            throw new InvalidOperationException("Cannot delete SlaveGroup as long as there are Slaves in the group");
+          }
+          db.Resources.DeleteOnSubmit(entity);
+        }
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region Resource Methods
+    public DT.Resource GetResource(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Resources.SingleOrDefault(x => x.ResourceId == id));
+      }
+    }
+
+    public IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Resources.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddResource(DT.Resource dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Resources.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.ResourceId;
+      }
+    }
+
+    public void UpdateResource(DT.Resource dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Resources.FirstOrDefault(x => x.ResourceId == dto.Id);
+        if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteResource(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Resources.FirstOrDefault(x => x.ResourceId == id);
+        if (entity != null) db.Resources.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void AssignJobToResource(Guid jobId, Guid resourceId) {
+      using (var db = CreateContext()) {
+        var job = db.Jobs.Where(x => x.JobId == jobId).Single();
+        job.AssignedResources.Add(new AssignedResource() { JobId = jobId, ResourceId = resourceId });
+        db.SubmitChanges();
+      }
+    }
+
+    public IEnumerable<DT.Resource> GetAssignedResources(Guid jobId) {
+      using (var db = CreateContext()) {
+        var job = db.Jobs.Where(x => x.JobId == jobId).Single();
+        return job.AssignedResources.Select(x => Convert.ToDto(x.Resource)).ToArray();
+      }
+    }
+
+    /// <summary>
+    /// Returns all parent resources of a resource (the given resource is also added)
+    /// </summary>
+    public IEnumerable<DT.Resource> GetParentResources(Guid resourceId) {
+      using (var db = CreateContext()) {
+        var resources = new List<Resource>();
+        CollectParentResources(resources, db.Resources.Where(r => r.ResourceId == resourceId).Single());
+        return resources.Select(r => Convert.ToDto(r)).ToArray();
+      }
+    }
+
+    private void CollectParentResources(List<Resource> resources, Resource resource) {
+      if (resource == null) return;
+      resources.Add(resource);
+      CollectParentResources(resources, resource.ParentResource);
+    }
+
+    /// <summary>
+    /// Returns all child resources of a resource (without the given resource)
+    /// </summary>
+    public IEnumerable<DT.Resource> GetChildResources(Guid resourceId) {
+      using (var db = CreateContext()) {
+        var childs = new List<DT.Resource>();
+        foreach (var child in db.Resources.Where(x => x.ParentResourceId == resourceId)) {
+          childs.Add(Convert.ToDto(child));
+          childs.AddRange(GetChildResources(child.ResourceId));
+        }
+        return childs;
+      }
+    }
+
+    public IEnumerable<DT.Job> GetJobsByResourceId(Guid resourceId) {
+      using (var db = CreateContext()) {
+        var resources = GetChildResources(resourceId).Select(x => x.Id).ToList();
+        resources.Add(resourceId);
+
+        var jobs = db.Jobs.Where(j =>
+          j.State == JobState.Calculating &&
+          j.StateLogs.OrderByDescending(x => x.DateTime).First().SlaveId.HasValue &&
+          resources.Contains(j.StateLogs.OrderByDescending(x => x.DateTime).First().SlaveId.Value));
+        return jobs.Select(j => Convert.ToDto(j)).ToArray();
+      }
+    }
+    #endregion
+
+    #region Authorization Methods
+    public Permission GetPermissionForJob(Guid jobId, Guid userId) {
+      using (var db = CreateContext()) {
+        return GetPermissionForExperiment(GetExperimentForJob(jobId), userId);
+      }
+    }
+
+    public Permission GetPermissionForExperiment(Guid experimentId, Guid userId) {
+      using (var db = CreateContext()) {
+        HiveExperiment hiveExperiment = db.HiveExperiments.SingleOrDefault(x => x.HiveExperimentId == experimentId);
+        if (hiveExperiment == null) return Permission.NotAllowed;
+        if (hiveExperiment.OwnerUserId == userId) return Permission.Full;
+        HiveExperimentPermission permission = db.HiveExperimentPermissions.SingleOrDefault(p => p.HiveExperimentId == experimentId && p.GrantedUserId == userId);
+        return permission != null ? permission.Permission : Permission.NotAllowed;
+      }
+    }
+
+    public Guid GetExperimentForJob(Guid jobId) {
+      using (var db = CreateContext()) {
+        return db.Jobs.Single(j => j.JobId == jobId).HiveExperimentId;
+      }
+    }
+    #endregion
+
+    #region Lifecycle Methods
+    public DateTime GetLastCleanup() {
+      using (var db = CreateContext()) {
+        var entity = db.Lifecycles.SingleOrDefault();
+        return entity != null ? entity.LastCleanup : DateTime.MinValue;
+      }
+    }
+
+    public void SetLastCleanup(DateTime datetime) {
+      using (var db = CreateContext()) {
+        var entity = db.Lifecycles.SingleOrDefault();
+        if (entity != null) {
+          entity.LastCleanup = datetime;
+        } else {
+          entity = new Lifecycle();
+          entity.LifecycleId = 0; // always only one entry with ID:0
+          entity.LastCleanup = datetime;
+          db.Lifecycles.InsertOnSubmit(entity);
+        }
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region Downtime Methods
+    public DT.Downtime GetDowntime(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Downtimes.SingleOrDefault(x => x.DowntimeId == id));
+      }
+    }
+
+    public IEnumerable<DT.Downtime> GetDowntimes(Expression<Func<Downtime, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Downtimes.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddDowntime(DT.Downtime dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Downtimes.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.DowntimeId;
+      }
+    }
+
+    public void UpdateDowntime(DT.Downtime dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Downtimes.FirstOrDefault(x => x.DowntimeId == dto.Id);
+        if (entity == null) db.Downtimes.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeleteDowntime(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Downtimes.FirstOrDefault(x => x.DowntimeId == id);
+        if (entity != null) db.Downtimes.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region Statistics Methods
+    public DT.Statistics GetStatistic(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Statistics.SingleOrDefault(x => x.StatisticsId == id));
+      }
+    }
+
+    public IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Statistics.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddStatistics(DT.Statistics dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Statistics.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        foreach (var slaveStat in dto.SlaveStatistics) {
+          slaveStat.Id = entity.StatisticsId;
+          db.SlaveStatistics.InsertOnSubmit(Convert.ToEntity(slaveStat));
+        }
+        foreach (var userStat in dto.UserStatistics) {
+          userStat.Id = entity.StatisticsId;
+          db.UserStatistics.InsertOnSubmit(Convert.ToEntity(userStat));
+        }
+        db.SubmitChanges();
+        return entity.StatisticsId;
+      }
+    }
+
+    public void DeleteStatistics(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Statistics.FirstOrDefault(x => x.StatisticsId == id);
+        if (entity != null) db.Statistics.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public List<DT.UserStatistics> GetUserStatistics() {
+      using (var db = CreateContext()) {
+        var userStats = new Dictionary<Guid, DT.UserStatistics>();
+
+        var usedCoresByUser = from job in db.Jobs
+                              where job.State == JobState.Calculating
+                              group job by job.HiveExperiment.OwnerUserId into g
+                              select new { UserId = g.Key, UsedCores = g.Count() };
+
+        foreach (var item in usedCoresByUser) {
+          if (!userStats.ContainsKey(item.UserId)) {
+            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
+          }
+          userStats[item.UserId].UsedCores += item.UsedCores;
+        }
+
+        var executionTimesByUser = from job in db.Jobs
+                                   group job by job.HiveExperiment.OwnerUserId into g
+                                   select new { UserId = g.Key, ExecutionTime = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()) };
+        foreach (var item in executionTimesByUser) {
+          if (!userStats.ContainsKey(item.UserId)) {
+            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
+          }
+          userStats[item.UserId].ExecutionTime += item.ExecutionTime;
+        }
+
+        // execution times only of finished jobs - necessary to compute efficieny
+        var executionTimesFinishedJobs = from job in db.Jobs
+                                         where job.State == JobState.Finished
+                                         group job by job.HiveExperiment.OwnerUserId into g
+                                         select new { UserId = g.Key, ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()) };
+
+        foreach (var item in executionTimesFinishedJobs) {
+          if (!userStats.ContainsKey(item.UserId)) {
+            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
+          }
+          userStats[item.UserId].ExecutionTimeFinishedJobs += item.ExecutionTimeFinishedJobs;
+        }
+
+        // start to end times only of finished jobs - necessary to compute efficiency
+        var startToEndTimesFinishedJobs = from job in db.Jobs
+                                          where job.State == JobState.Finished
+                                          group job by job.HiveExperiment.OwnerUserId into g
+                                          select new {
+                                            UserId = g.Key,
+                                            StartToEndTime = new TimeSpan(g.Select(x => x.StateLogs.OrderByDescending(sl => sl.DateTime).First().DateTime - x.StateLogs.OrderBy(sl => sl.DateTime).First().DateTime).Sum(ts => ts.Ticks))
+                                          };
+        foreach (var item in startToEndTimesFinishedJobs) {
+          if (!userStats.ContainsKey(item.UserId)) {
+            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
+          }
+          userStats[item.UserId].StartToEndTime += item.StartToEndTime;
+        }
+
+        // also consider executiontimes of DeletedJobStats 
+        var deletedJobsExecutionTimesByUsers = from del in db.DeletedJobStatistics
+                                               group del by del.UserId into g
+                                               select new {
+                                                 UserId = g.Key,
+                                                 ExecutionTime = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()),
+                                                 ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMsFinishedJobs).Sum()),
+                                                 StartToEndTime = TimeSpan.FromMilliseconds(g.Select(x => x.StartToEndTimeMs).Sum())
+                                               };
+        foreach (var item in deletedJobsExecutionTimesByUsers) {
+          if (!userStats.ContainsKey(item.UserId)) {
+            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
+          }
+          userStats[item.UserId].ExecutionTime += item.ExecutionTime;
+          userStats[item.UserId].ExecutionTimeFinishedJobs += item.ExecutionTimeFinishedJobs;
+          userStats[item.UserId].StartToEndTime += item.StartToEndTime;
+        }
+
+        return userStats.Values.ToList();
+      }
+    }
+    #endregion
+
+    #region Helpers
+    private void CollectChildJobs(HiveDataContext db, Guid parentJobId, List<Job> collection) {
+      var jobs = db.Jobs.Where(j => j.ParentJobId == parentJobId);
+      foreach (var job in jobs) {
+        collection.Add(job);
+        if (job.IsParentJob)
+          CollectChildJobs(db, job.JobId, collection);
+      }
+    }
+    #endregion
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.cs	(revision 6701)
@@ -0,0 +1,15 @@
+using System;
+using System.Data.Linq.Mapping;
+namespace HeuristicLab.Services.Hive.DataAccess {
+  partial class SlaveStatistics {
+  }
+
+  partial class HiveDataContext {
+    // source: http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql
+    [Function(Name = "NEWID", IsComposable = true)]
+    public Guid Random() { 
+      // to prove not used by our C# code... 
+      throw new NotImplementedException();
+    }
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 6701)
@@ -0,0 +1,195 @@
+﻿<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
+  <Connection Mode="AppSettings" ConnectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True" SettingsObjectName="HeuristicLab.Services.Hive.DataAccess.Settings" SettingsPropertyName="HeuristicLab_Hive_LinqConnectionString" Provider="System.Data.SqlClient" />
+  <Table Name="dbo.AssignedResources" Member="AssignedResources">
+    <Type Name="AssignedResource">
+      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" />
+    </Type>
+  </Table>
+  <Table Name="dbo.Plugin" Member="Plugins">
+    <Type Name="Plugin">
+      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+      <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
+      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+      <Column Name="Hash" Type="System.Byte[]" DbType="VarBinary(20) NOT NULL" CanBeNull="false" />
+      <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
+      <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" />
+    </Type>
+  </Table>
+  <Table Name="dbo.RequiredPlugins" Member="RequiredPlugins">
+    <Type Name="RequiredPlugin">
+      <Column Name="RequiredPluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" UpdateCheck="Never" />
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Association Name="Plugin_RequiredPlugin" Member="Plugin" Storage="_PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.Resource" Member="Resources">
+    <Type Name="Resource" InheritanceCode="RESOURCE">
+      <Column Name="ResourceId" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+      <Column Name="ResourceType" Type="System.String" CanBeNull="false" IsDiscriminator="true" />
+      <Column Name="ParentResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource" />
+      <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
+      <Association Name="Resource_Downtime" Member="Downtimes" Storage="_UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="Downtime" />
+      <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
+      <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
+      <Type Name="Slave" InheritanceCode="Slave" IsInheritanceDefault="true">
+        <Column Name="CpuSpeed" Storage="_CPUSpeed" Type="System.Int32" DbType="Int" CanBeNull="true" />
+        <Column Name="Memory" Type="System.Int32" DbType="Int" CanBeNull="true" />
+        <Column Name="Login" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+        <Column Name="SlaveState" Storage="_Status" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState" DbType="VarChar(15)" CanBeNull="true" />
+        <Column Name="Cores" Storage="_NumberOfCores" Type="System.Int32" DbType="Int" CanBeNull="true" />
+        <Column Name="FreeCores" Storage="_NumberOfFreeCores" Type="System.Int32" DbType="Int" CanBeNull="true" />
+        <Column Name="FreeMemory" Type="System.Int32" DbType="Int" CanBeNull="true" />
+        <Column Name="IsAllowedToCalculate" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+        <Column Name="CpuArchitecture" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture" DbType="VarChar(3)" CanBeNull="false" />
+        <Column Name="OperatingSystem" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" UpdateCheck="Never" />
+        <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+        <Column Name="CpuUtilization" Type="System.Double" DbType="float" CanBeNull="false" />
+      </Type>
+      <Type Name="SlaveGroup" InheritanceCode="GROUP" />
+    </Type>
+  </Table>
+  <Table Name="dbo.Job" Member="Jobs">
+    <Type Name="Job">
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="JobState" Member="State" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(30)" CanBeNull="false" />
+      <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float" CanBeNull="false" />
+      <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="Priority" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="IsParentJob" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+      <Column Name="FinishWhenChildJobsFinished" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+      <Column Name="Command" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.Command?" DbType="VarChar(30)" CanBeNull="true" />
+      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="IsPrivileged" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
+      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
+      <Association Name="Job_Job" Member="ChildJobs" Storage="_Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
+      <Association Name="Job_JobData" Member="JobData" ThisKey="JobId" OtherKey="JobId" Type="JobData" Cardinality="One" />
+      <Association Name="Job_StateLog" Member="StateLogs" ThisKey="JobId" OtherKey="JobId" Type="StateLog" />
+      <Association Name="Job_Job" Member="ParentJob" Storage="_Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+      <Association Name="HiveExperiment_Job" Member="HiveExperiment" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperiment" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.Downtime" Member="Downtimes">
+    <Type Name="Downtime">
+      <Column Name="DowntimeId" Storage="_UptimeCalendarId" Type="System.Guid" DbType="UniqueIdentifier" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
+      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+      <Column Name="AllDayEvent" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+      <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+      <Column Name="RecurringId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
+      <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
+    </Type>
+  </Table>
+  <Table Name="dbo.HiveExperiment" Member="HiveExperiments">
+    <Type Name="HiveExperiment">
+      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+      <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
+      <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
+      <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
+      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+      <Column Name="LastAccessed" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
+      <Column Name="IsHiveEngine" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
+      <Association Name="HiveExperiment_Job" Member="Jobs" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="Job" />
+      <Association Name="HiveExperiment_HiveExperimentPermission" Member="HiveExperimentPermissions" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperimentPermission" />
+    </Type>
+  </Table>
+  <Table Name="dbo.JobData" Member="JobDatas">
+    <Type Name="JobData">
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="false" UpdateCheck="Never" />
+      <Column Name="LastUpdate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+      <Association Name="Job_JobData" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.PluginData" Member="PluginDatas">
+    <Type Name="PluginData">
+      <Column Name="PluginDataId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX) NOT NULL" CanBeNull="false" UpdateCheck="Never" />
+      <Column Name="FileName" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+      <Association Name="Plugin_PluginData" Member="Plugin" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.StateLog" Member="StateLogs">
+    <Type Name="StateLog">
+      <Column Name="StateLogId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="State" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(30) NOT NULL" CanBeNull="false" />
+      <Column Name="DateTime" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="SlaveId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
+      <Column Name="Exception" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+      <Association Name="Job_StateLog" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+      <Association Name="Resource_StateLog" Member="Resource" ThisKey="SlaveId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="dbo.HiveExperimentPermission" Member="HiveExperimentPermissions">
+    <Type Name="HiveExperimentPermission">
+      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="Permission" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission" DbType="VarChar(15) NOT NULL" CanBeNull="false" />
+      <Association Name="HiveExperiment_HiveExperimentPermission" Member="HiveExperiment" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperiment" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="" Member="Lifecycles">
+    <Type Name="Lifecycle">
+      <Column Name="LifecycleId" Type="System.Int32" DbType="Int" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="LastCleanup" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
+    </Type>
+  </Table>
+  <Table Name="" Member="DeletedJobStatistics">
+    <Type Name="DeletedJobStatistics">
+      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Column Name="ExecutionTimeMsFinishedJobs" Storage="_ExecutionTimeFinishedJobs" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Column Name="StartToEndTimeMs" Storage="_StartToEndTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Column Name="DeletedJobStatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+    </Type>
+  </Table>
+  <Table Name="" Member="UserStatistics">
+    <Type Name="UserStatistics">
+      <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Column Name="UsedCores" Storage="_CoresUsed" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="ExecutionTimeMsFinishedJobs" Storage="_ExecutionTimeFinishedJobs" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Column Name="StartToEndTimeMs" Storage="_StartToEndTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Association Name="Statistics_UserStatistics" Member="Statistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="Statistics" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="" Member="SlaveStatistics">
+    <Type Name="SlaveStatistics">
+      <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="SlaveId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Name="Cores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="FreeCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="CpuUtilization" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
+      <Column Name="Memory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="FreeMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Association Name="Statistics_SlaveStatistics" Member="Statistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="Statistics" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="" Member="Statistics">
+    <Type Name="Statistics">
+      <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Name="Timestamp" Type="System.DateTime" CanBeNull="false" />
+      <Association Name="Statistics_UserStatistics" Member="UserStatistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="UserStatistics" />
+      <Association Name="Statistics_SlaveStatistics" Member="SlaveStatistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="SlaveStatistics" />
+    </Type>
+  </Table>
+</Database>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 6701)
@@ -0,0 +1,231 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 24.25, 8.5" name="HiveDataContext">
+  <DataContextMoniker Name="/HiveDataContext" />
+  <nestedChildShapes>
+    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 4, 2, 1.1939925130208327">
+      <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
+      <nestedChildShapes>
+        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.4600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 1.9631982421874996">
+      <DataClassMoniker Name="/HiveDataContext/Plugin" />
+      <nestedChildShapes>
+        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="6.5, 5.5, 2, 1.3862939453124987">
+      <DataClassMoniker Name="/HiveDataContext/RequiredPlugin" />
+      <nestedChildShapes>
+        <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="6.5150000000000006, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.25, 1, 2, 1.5785953776041666">
+      <DataClassMoniker Name="/HiveDataContext/Resource" />
+      <nestedChildShapes>
+        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.265, 1.46, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.3093082682291666">
+      <DataClassMoniker Name="/HiveDataContext/Job" />
+      <nestedChildShapes>
+        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="13.5, 2.5, 2, 2.1554996744791666">
+      <DataClassMoniker Name="/HiveDataContext/Downtime" />
+      <nestedChildShapes>
+        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="13.515, 2.9600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.3478011067708326">
+      <DataClassMoniker Name="/HiveDataContext/HiveExperiment" />
+      <nestedChildShapes>
+        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="8.875, 0.75, 2, 3.1170068359375">
+      <DataClassMoniker Name="/HiveDataContext/Slave" />
+      <nestedChildShapes>
+        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="8.89, 1.21, 1.9700000000000002, 2.5570068359375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="13.5, 1, 2, 0.8093896484375">
+      <DataClassMoniker Name="/HiveDataContext/SlaveGroup" />
+      <nestedChildShapes>
+        <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="13.5, 1, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <inheritanceConnector edgePoints="[(11.25 : 1.78929768880208); (10.875 : 1.78929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="26f4edfa-91dd-4941-a058-359f89e567a8" />
+      </nodes>
+    </inheritanceConnector>
+    <inheritanceConnector edgePoints="[(13.25 : 1.40469482421875); (13.5 : 1.40469482421875)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="bbd91675-92f2-4a69-8429-0950008fc8a4" />
+      </nodes>
+    </inheritanceConnector>
+    <associationConnector edgePoints="[(11.9843735 : 2.57859537760417); (11.9843735 : 4.59699625651042); (10.875 : 4.59699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(7.5 : 4.30930826822917); (7.5 : 4.751650890625); (8.875 : 4.751650890625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
+      <nodes>
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(7.0893551015625 : 4.30930826822917); (7.0893551015625 : 5.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
+      <nodes>
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+        <classShapeMoniker Id="97b00810-fa30-457e-b484-b4e80b22f91b" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(7.20923076923077 : 1); (7.20923076923077 : 0.75); (7.80461538461539 : 0.75); (7.80461538461539 : 1)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
+      <nodes>
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
+      <DataClassMoniker Name="/HiveDataContext/JobData" />
+      <nestedChildShapes>
+        <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="4.14, 1.46, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.25, 5.5, 2, 1.5785953776041666">
+      <DataClassMoniker Name="/HiveDataContext/PluginData" />
+      <nestedChildShapes>
+        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.265, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
+      <nodes>
+        <classShapeMoniker Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" />
+        <classShapeMoniker Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
+      <nodes>
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+        <classShapeMoniker Id="6bc13f26-f9a8-4597-b054-35be34190d12" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
+      <nodes>
+        <classShapeMoniker Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" />
+        <classShapeMoniker Id="97b00810-fa30-457e-b484-b4e80b22f91b" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(11.9524234637921 : 1); (11.9524234637921 : 0.75); (12.5617468474559 : 0.75); (12.5617468474559 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Resource" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="00352397-340e-449a-8e23-6ddd216e8617" absoluteBounds="1.75, 1, 2, 2.1554996744791666">
+      <DataClassMoniker Name="/HiveDataContext/StateLog" />
+      <nestedChildShapes>
+        <elementListCompartment Id="9a003897-deef-4bb5-b180-4c4bcdb7fadc" absoluteBounds="1.765, 1.46, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="4d800dc9-1b18-469f-b02c-d4554757c5e1" absoluteBounds="1.75, 3.625, 2, 1.5785953776041666">
+      <DataClassMoniker Name="/HiveDataContext/HiveExperimentPermission" />
+      <nestedChildShapes>
+        <elementListCompartment Id="dedd97d3-a9a2-45a2-9b95-d7366fb65a7f" absoluteBounds="1.765, 4.085, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_StateLog" />
+      <nodes>
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+        <classShapeMoniker Id="00352397-340e-449a-8e23-6ddd216e8617" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(11.25 : 1.78929768880208); (10.9375 : 1.78929768880208); (10.9375 : 0.6875); (2.75 : 0.6875); (2.75 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_StateLog" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="00352397-340e-449a-8e23-6ddd216e8617" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(4.125 : 4.29890055338542); (3.75 : 4.29890055338542)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/HiveExperiment/HiveExperiment_HiveExperimentPermission" />
+      <nodes>
+        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
+        <classShapeMoniker Id="4d800dc9-1b18-469f-b02c-d4554757c5e1" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="b4e7aaa8-a382-4560-a1fd-498de77e9340" absoluteBounds="1.75, 5.5, 2, 1.1939925130208327">
+      <DataClassMoniker Name="/HiveDataContext/Lifecycle" />
+      <nestedChildShapes>
+        <elementListCompartment Id="03597a2c-5c5d-4c2c-b741-c49ab5aa34d5" absoluteBounds="1.7650000000000001, 5.96, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(6.125 : 3.46715413411458); (6.5 : 3.46715413411458)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/HiveExperiment/HiveExperiment_Job" />
+      <nodes>
+        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="cdddf4da-eaef-46a1-9cfd-987bb6b3d03e" absoluteBounds="17, 3.125, 2.5, 1.7708968098958327">
+      <DataClassMoniker Name="/HiveDataContext/DeletedJobStatistics" />
+      <nestedChildShapes>
+        <elementListCompartment Id="b8738381-f696-4dba-a517-47e9cd96a9a6" absoluteBounds="17.015, 3.585, 2.4699999999999998, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="25442617-ff41-49a0-b5d5-4cbe0b2f0f45" absoluteBounds="22, 4.5, 2, 1.9631982421874996">
+      <DataClassMoniker Name="/HiveDataContext/UserStatistics" />
+      <nestedChildShapes>
+        <elementListCompartment Id="6edf08e7-054a-4253-8d4f-5bf2dfec2d29" absoluteBounds="22.015, 4.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="f78ec989-4862-4bac-87e3-9b0aad4bc037" absoluteBounds="19.875, 4.5, 2, 2.1554996744791666">
+      <DataClassMoniker Name="/HiveDataContext/SlaveStatistics" />
+      <nestedChildShapes>
+        <elementListCompartment Id="98cb46fe-820e-4041-aee8-04e8bed3df23" absoluteBounds="19.89, 4.96, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" absoluteBounds="21, 3, 2, 1.1939925130208327">
+      <DataClassMoniker Name="/HiveDataContext/Statistics" />
+      <nestedChildShapes>
+        <elementListCompartment Id="17821282-8edf-40b7-9065-84f53391d5c1" absoluteBounds="21.015, 3.46, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(21.4375 : 4.19399251302083); (21.4375 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Statistics/Statistics_SlaveStatistics" />
+      <nodes>
+        <classShapeMoniker Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" />
+        <classShapeMoniker Id="f78ec989-4862-4bac-87e3-9b0aad4bc037" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(22.5 : 4.19399251302083); (22.5 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Statistics/Statistics_UserStatistics" />
+      <nodes>
+        <classShapeMoniker Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" />
+        <classShapeMoniker Id="25442617-ff41-49a0-b5d5-4cbe0b2f0f45" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.64829952604167); (13.5 : 3.64829952604167)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Downtime" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" />
+      </nodes>
+    </associationConnector>
+  </nestedChildShapes>
+</ordesignerObjectsDiagram>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 6701)
@@ -0,0 +1,4202 @@
+﻿#pragma warning disable 1591
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.235
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Services.Hive.DataAccess
+{
+	using System.Data.Linq;
+	using System.Data.Linq.Mapping;
+	using System.Data;
+	using System.Collections.Generic;
+	using System.Reflection;
+	using System.Linq;
+	using System.Linq.Expressions;
+	using System.ComponentModel;
+	using System;
+	
+	
+	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="HeuristicLab.Hive")]
+	public partial class HiveDataContext : System.Data.Linq.DataContext
+	{
+		
+		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
+		
+    #region Extensibility Method Definitions
+    partial void OnCreated();
+    partial void InsertAssignedResource(AssignedResource instance);
+    partial void UpdateAssignedResource(AssignedResource instance);
+    partial void DeleteAssignedResource(AssignedResource instance);
+    partial void InsertPlugin(Plugin instance);
+    partial void UpdatePlugin(Plugin instance);
+    partial void DeletePlugin(Plugin instance);
+    partial void InsertRequiredPlugin(RequiredPlugin instance);
+    partial void UpdateRequiredPlugin(RequiredPlugin instance);
+    partial void DeleteRequiredPlugin(RequiredPlugin instance);
+    partial void InsertResource(Resource instance);
+    partial void UpdateResource(Resource instance);
+    partial void DeleteResource(Resource instance);
+    partial void InsertJob(Job instance);
+    partial void UpdateJob(Job instance);
+    partial void DeleteJob(Job instance);
+    partial void InsertDowntime(Downtime instance);
+    partial void UpdateDowntime(Downtime instance);
+    partial void DeleteDowntime(Downtime instance);
+    partial void InsertHiveExperiment(HiveExperiment instance);
+    partial void UpdateHiveExperiment(HiveExperiment instance);
+    partial void DeleteHiveExperiment(HiveExperiment instance);
+    partial void InsertJobData(JobData instance);
+    partial void UpdateJobData(JobData instance);
+    partial void DeleteJobData(JobData instance);
+    partial void InsertPluginData(PluginData instance);
+    partial void UpdatePluginData(PluginData instance);
+    partial void DeletePluginData(PluginData instance);
+    partial void InsertStateLog(StateLog instance);
+    partial void UpdateStateLog(StateLog instance);
+    partial void DeleteStateLog(StateLog instance);
+    partial void InsertHiveExperimentPermission(HiveExperimentPermission instance);
+    partial void UpdateHiveExperimentPermission(HiveExperimentPermission instance);
+    partial void DeleteHiveExperimentPermission(HiveExperimentPermission instance);
+    partial void InsertLifecycle(Lifecycle instance);
+    partial void UpdateLifecycle(Lifecycle instance);
+    partial void DeleteLifecycle(Lifecycle instance);
+    partial void InsertDeletedJobStatistics(DeletedJobStatistics instance);
+    partial void UpdateDeletedJobStatistics(DeletedJobStatistics instance);
+    partial void DeleteDeletedJobStatistics(DeletedJobStatistics instance);
+    partial void InsertUserStatistics(UserStatistics instance);
+    partial void UpdateUserStatistics(UserStatistics instance);
+    partial void DeleteUserStatistics(UserStatistics instance);
+    partial void InsertSlaveStatistics(SlaveStatistics instance);
+    partial void UpdateSlaveStatistics(SlaveStatistics instance);
+    partial void DeleteSlaveStatistics(SlaveStatistics instance);
+    partial void InsertStatistics(Statistics instance);
+    partial void UpdateStatistics(Statistics instance);
+    partial void DeleteStatistics(Statistics instance);
+    #endregion
+		
+		public HiveDataContext() : 
+				base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(string connection) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(System.Data.IDbConnection connection) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public System.Data.Linq.Table<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this.GetTable<AssignedResource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Plugin> Plugins
+		{
+			get
+			{
+				return this.GetTable<Plugin>();
+			}
+		}
+		
+		public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this.GetTable<RequiredPlugin>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Resource> Resources
+		{
+			get
+			{
+				return this.GetTable<Resource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Job> Jobs
+		{
+			get
+			{
+				return this.GetTable<Job>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Downtime> Downtimes
+		{
+			get
+			{
+				return this.GetTable<Downtime>();
+			}
+		}
+		
+		public System.Data.Linq.Table<HiveExperiment> HiveExperiments
+		{
+			get
+			{
+				return this.GetTable<HiveExperiment>();
+			}
+		}
+		
+		public System.Data.Linq.Table<JobData> JobDatas
+		{
+			get
+			{
+				return this.GetTable<JobData>();
+			}
+		}
+		
+		public System.Data.Linq.Table<PluginData> PluginDatas
+		{
+			get
+			{
+				return this.GetTable<PluginData>();
+			}
+		}
+		
+		public System.Data.Linq.Table<StateLog> StateLogs
+		{
+			get
+			{
+				return this.GetTable<StateLog>();
+			}
+		}
+		
+		public System.Data.Linq.Table<HiveExperimentPermission> HiveExperimentPermissions
+		{
+			get
+			{
+				return this.GetTable<HiveExperimentPermission>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Lifecycle> Lifecycles
+		{
+			get
+			{
+				return this.GetTable<Lifecycle>();
+			}
+		}
+		
+		public System.Data.Linq.Table<DeletedJobStatistics> DeletedJobStatistics
+		{
+			get
+			{
+				return this.GetTable<DeletedJobStatistics>();
+			}
+		}
+		
+		public System.Data.Linq.Table<UserStatistics> UserStatistics
+		{
+			get
+			{
+				return this.GetTable<UserStatistics>();
+			}
+		}
+		
+		public System.Data.Linq.Table<SlaveStatistics> SlaveStatistics
+		{
+			get
+			{
+				return this.GetTable<SlaveStatistics>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Statistics> Statistics
+		{
+			get
+			{
+				return this.GetTable<Statistics>();
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResources")]
+	public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ResourceId;
+		
+		private System.Guid _JobId;
+		
+		private EntityRef<Resource> _Resource;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    #endregion
+		
+		public AssignedResource()
+		{
+			this._Resource = default(EntityRef<Resource>);
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.AssignedResources.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedResources.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.AssignedResources.Remove(this);
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedResources.Add(this);
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Plugin")]
+	public partial class Plugin : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _PluginId;
+		
+		private string _Name;
+		
+		private string _Version;
+		
+		private System.Guid _UserId;
+		
+		private System.DateTime _DateCreated;
+		
+		private byte[] _Hash;
+		
+		private EntitySet<RequiredPlugin> _RequiredPlugins;
+		
+		private EntitySet<PluginData> _PluginData;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnPluginIdChanging(System.Guid value);
+    partial void OnPluginIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnVersionChanging(string value);
+    partial void OnVersionChanged();
+    partial void OnUserIdChanging(System.Guid value);
+    partial void OnUserIdChanged();
+    partial void OnDateCreatedChanging(System.DateTime value);
+    partial void OnDateCreatedChanged();
+    partial void OnHashChanging(byte[] value);
+    partial void OnHashChanged();
+    #endregion
+		
+		public Plugin()
+		{
+			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
+			this._PluginData = new EntitySet<PluginData>(new Action<PluginData>(this.attach_PluginData), new Action<PluginData>(this.detach_PluginData));
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid PluginId
+		{
+			get
+			{
+				return this._PluginId;
+			}
+			set
+			{
+				if ((this._PluginId != value))
+				{
+					this.OnPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._PluginId = value;
+					this.SendPropertyChanged("PluginId");
+					this.OnPluginIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Version", DbType="VarChar(MAX)", CanBeNull=false)]
+		public string Version
+		{
+			get
+			{
+				return this._Version;
+			}
+			set
+			{
+				if ((this._Version != value))
+				{
+					this.OnVersionChanging(value);
+					this.SendPropertyChanging();
+					this._Version = value;
+					this.SendPropertyChanged("Version");
+					this.OnVersionChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
+		public System.Guid UserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("UserId");
+					this.OnUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
+		public System.DateTime DateCreated
+		{
+			get
+			{
+				return this._DateCreated;
+			}
+			set
+			{
+				if ((this._DateCreated != value))
+				{
+					this.OnDateCreatedChanging(value);
+					this.SendPropertyChanging();
+					this._DateCreated = value;
+					this.SendPropertyChanged("DateCreated");
+					this.OnDateCreatedChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hash", DbType="VarBinary(20) NOT NULL", CanBeNull=false)]
+		public byte[] Hash
+		{
+			get
+			{
+				return this._Hash;
+			}
+			set
+			{
+				if ((this._Hash != value))
+				{
+					this.OnHashChanging(value);
+					this.SendPropertyChanging();
+					this._Hash = value;
+					this.SendPropertyChanged("Hash");
+					this.OnHashChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="PluginId", OtherKey="PluginId")]
+		public EntitySet<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this._RequiredPlugins;
+			}
+			set
+			{
+				this._RequiredPlugins.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_PluginData", ThisKey="PluginId", OtherKey="PluginId")]
+		public EntitySet<PluginData> PluginData
+		{
+			get
+			{
+				return this._PluginData;
+			}
+			set
+			{
+				this._PluginData.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Plugin = this;
+		}
+		
+		private void detach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Plugin = null;
+		}
+		
+		private void attach_PluginData(PluginData entity)
+		{
+			this.SendPropertyChanging();
+			entity.Plugin = this;
+		}
+		
+		private void detach_PluginData(PluginData entity)
+		{
+			this.SendPropertyChanging();
+			entity.Plugin = null;
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RequiredPlugins")]
+	public partial class RequiredPlugin : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _RequiredPluginId;
+		
+		private System.Guid _JobId;
+		
+		private System.Guid _PluginId;
+		
+		private EntityRef<Plugin> _PluginInfo;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnRequiredPluginIdChanging(System.Guid value);
+    partial void OnRequiredPluginIdChanged();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnPluginIdChanging(System.Guid value);
+    partial void OnPluginIdChanged();
+    #endregion
+		
+		public RequiredPlugin()
+		{
+			this._PluginInfo = default(EntityRef<Plugin>);
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RequiredPluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
+		public System.Guid RequiredPluginId
+		{
+			get
+			{
+				return this._RequiredPluginId;
+			}
+			set
+			{
+				if ((this._RequiredPluginId != value))
+				{
+					this.OnRequiredPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._RequiredPluginId = value;
+					this.SendPropertyChanged("RequiredPluginId");
+					this.OnRequiredPluginIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid PluginId
+		{
+			get
+			{
+				return this._PluginId;
+			}
+			set
+			{
+				if ((this._PluginId != value))
+				{
+					if (this._PluginInfo.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._PluginId = value;
+					this.SendPropertyChanged("PluginId");
+					this.OnPluginIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Plugin Plugin
+		{
+			get
+			{
+				return this._PluginInfo.Entity;
+			}
+			set
+			{
+				Plugin previousValue = this._PluginInfo.Entity;
+				if (((previousValue != value) 
+							|| (this._PluginInfo.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._PluginInfo.Entity = null;
+						previousValue.RequiredPlugins.Remove(this);
+					}
+					this._PluginInfo.Entity = value;
+					if ((value != null))
+					{
+						value.RequiredPlugins.Add(this);
+						this._PluginId = value.PluginId;
+					}
+					else
+					{
+						this._PluginId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Plugin");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.RequiredPlugins.Remove(this);
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.RequiredPlugins.Add(this);
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Resource")]
+	[global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="RESOURCE", Type=typeof(Resource))]
+	[global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="Slave", Type=typeof(Slave), IsDefault=true)]
+	[global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="GROUP", Type=typeof(SlaveGroup))]
+	public partial class Resource : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ResourceId;
+		
+		private string _Name;
+		
+		private string _ResourceType;
+		
+		private System.Nullable<System.Guid> _ParentResourceId;
+		
+		private EntitySet<AssignedResource> _AssignedResources;
+		
+		private EntitySet<Resource> _ChildResources;
+		
+		private EntitySet<Downtime> _UptimeCalendars;
+		
+		private EntitySet<StateLog> _StateLogs;
+		
+		private EntityRef<Resource> _ParentResource;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnResourceTypeChanging(string value);
+    partial void OnResourceTypeChanged();
+    partial void OnParentResourceIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentResourceIdChanged();
+    #endregion
+		
+		public Resource()
+		{
+			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
+			this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
+			this._UptimeCalendars = new EntitySet<Downtime>(new Action<Downtime>(this.attach_UptimeCalendars), new Action<Downtime>(this.detach_UptimeCalendars));
+			this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
+			this._ParentResource = default(EntityRef<Resource>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceType", CanBeNull=false, IsDiscriminator=true)]
+		public string ResourceType
+		{
+			get
+			{
+				return this._ResourceType;
+			}
+			set
+			{
+				if ((this._ResourceType != value))
+				{
+					this.OnResourceTypeChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceType = value;
+					this.SendPropertyChanged("ResourceType");
+					this.OnResourceTypeChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentResourceId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentResourceId
+		{
+			get
+			{
+				return this._ParentResourceId;
+			}
+			set
+			{
+				if ((this._ParentResourceId != value))
+				{
+					if (this._ParentResource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnParentResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentResourceId = value;
+					this.SendPropertyChanged("ParentResourceId");
+					this.OnParentResourceIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this._AssignedResources;
+			}
+			set
+			{
+				this._AssignedResources.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ChildResources", ThisKey="ResourceId", OtherKey="ParentResourceId")]
+		public EntitySet<Resource> ChildResources
+		{
+			get
+			{
+				return this._ChildResources;
+			}
+			set
+			{
+				this._ChildResources.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<Downtime> Downtimes
+		{
+			get
+			{
+				return this._UptimeCalendars;
+			}
+			set
+			{
+				this._UptimeCalendars.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_StateLog", Storage="_StateLogs", ThisKey="ResourceId", OtherKey="SlaveId")]
+		public EntitySet<StateLog> StateLogs
+		{
+			get
+			{
+				return this._StateLogs;
+			}
+			set
+			{
+				this._StateLogs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ParentResource", ThisKey="ParentResourceId", OtherKey="ResourceId", IsForeignKey=true)]
+		public Resource ParentResource
+		{
+			get
+			{
+				return this._ParentResource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._ParentResource.Entity;
+				if (((previousValue != value) 
+							|| (this._ParentResource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._ParentResource.Entity = null;
+						previousValue.ChildResources.Remove(this);
+					}
+					this._ParentResource.Entity = value;
+					if ((value != null))
+					{
+						value.ChildResources.Add(this);
+						this._ParentResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ParentResourceId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("ParentResource");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = this;
+		}
+		
+		private void detach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = null;
+		}
+		
+		private void attach_ChildResources(Resource entity)
+		{
+			this.SendPropertyChanging();
+			entity.ParentResource = this;
+		}
+		
+		private void detach_ChildResources(Resource entity)
+		{
+			this.SendPropertyChanging();
+			entity.ParentResource = null;
+		}
+		
+		private void attach_UptimeCalendars(Downtime entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = this;
+		}
+		
+		private void detach_UptimeCalendars(Downtime entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = null;
+		}
+		
+		private void attach_StateLogs(StateLog entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = this;
+		}
+		
+		private void detach_StateLogs(StateLog entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = null;
+		}
+	}
+	
+	public partial class Slave : Resource
+	{
+		
+		private System.Nullable<int> _CPUSpeed;
+		
+		private System.Nullable<int> _Memory;
+		
+		private System.Nullable<System.DateTime> _Login;
+		
+		private global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState _Status;
+		
+		private System.Nullable<int> _NumberOfCores;
+		
+		private System.Nullable<int> _NumberOfFreeCores;
+		
+		private System.Nullable<int> _FreeMemory;
+		
+		private bool _IsAllowedToCalculate;
+		
+		private global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture _CpuArchitecture;
+		
+		private string _OperatingSystem;
+		
+		private System.Nullable<System.DateTime> _LastHeartbeat;
+		
+		private double _CpuUtilization;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnCpuSpeedChanging(System.Nullable<int> value);
+    partial void OnCpuSpeedChanged();
+    partial void OnMemoryChanging(System.Nullable<int> value);
+    partial void OnMemoryChanged();
+    partial void OnLoginChanging(System.Nullable<System.DateTime> value);
+    partial void OnLoginChanged();
+    partial void OnSlaveStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState value);
+    partial void OnSlaveStateChanged();
+    partial void OnCoresChanging(System.Nullable<int> value);
+    partial void OnCoresChanged();
+    partial void OnFreeCoresChanging(System.Nullable<int> value);
+    partial void OnFreeCoresChanged();
+    partial void OnFreeMemoryChanging(System.Nullable<int> value);
+    partial void OnFreeMemoryChanged();
+    partial void OnIsAllowedToCalculateChanging(bool value);
+    partial void OnIsAllowedToCalculateChanged();
+    partial void OnCpuArchitectureChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture value);
+    partial void OnCpuArchitectureChanged();
+    partial void OnOperatingSystemChanging(string value);
+    partial void OnOperatingSystemChanged();
+    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
+    partial void OnLastHeartbeatChanged();
+    partial void OnCpuUtilizationChanging(double value);
+    partial void OnCpuUtilizationChanged();
+    #endregion
+		
+		public Slave()
+		{
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CPUSpeed", DbType="Int")]
+		public System.Nullable<int> CpuSpeed
+		{
+			get
+			{
+				return this._CPUSpeed;
+			}
+			set
+			{
+				if ((this._CPUSpeed != value))
+				{
+					this.OnCpuSpeedChanging(value);
+					this.SendPropertyChanging();
+					this._CPUSpeed = value;
+					this.SendPropertyChanged("CpuSpeed");
+					this.OnCpuSpeedChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Memory", DbType="Int")]
+		public System.Nullable<int> Memory
+		{
+			get
+			{
+				return this._Memory;
+			}
+			set
+			{
+				if ((this._Memory != value))
+				{
+					this.OnMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._Memory = value;
+					this.SendPropertyChanged("Memory");
+					this.OnMemoryChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="DateTime")]
+		public System.Nullable<System.DateTime> Login
+		{
+			get
+			{
+				return this._Login;
+			}
+			set
+			{
+				if ((this._Login != value))
+				{
+					this.OnLoginChanging(value);
+					this.SendPropertyChanging();
+					this._Login = value;
+					this.SendPropertyChanged("Login");
+					this.OnLoginChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Status", DbType="VarChar(15)", CanBeNull=true)]
+		public global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState SlaveState
+		{
+			get
+			{
+				return this._Status;
+			}
+			set
+			{
+				if ((this._Status != value))
+				{
+					this.OnSlaveStateChanging(value);
+					this.SendPropertyChanging();
+					this._Status = value;
+					this.SendPropertyChanged("SlaveState");
+					this.OnSlaveStateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfCores", DbType="Int")]
+		public System.Nullable<int> Cores
+		{
+			get
+			{
+				return this._NumberOfCores;
+			}
+			set
+			{
+				if ((this._NumberOfCores != value))
+				{
+					this.OnCoresChanging(value);
+					this.SendPropertyChanging();
+					this._NumberOfCores = value;
+					this.SendPropertyChanged("Cores");
+					this.OnCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfFreeCores", DbType="Int")]
+		public System.Nullable<int> FreeCores
+		{
+			get
+			{
+				return this._NumberOfFreeCores;
+			}
+			set
+			{
+				if ((this._NumberOfFreeCores != value))
+				{
+					this.OnFreeCoresChanging(value);
+					this.SendPropertyChanging();
+					this._NumberOfFreeCores = value;
+					this.SendPropertyChanged("FreeCores");
+					this.OnFreeCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeMemory", DbType="Int")]
+		public System.Nullable<int> FreeMemory
+		{
+			get
+			{
+				return this._FreeMemory;
+			}
+			set
+			{
+				if ((this._FreeMemory != value))
+				{
+					this.OnFreeMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._FreeMemory = value;
+					this.SendPropertyChanged("FreeMemory");
+					this.OnFreeMemoryChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsAllowedToCalculate", DbType="Bit")]
+		public bool IsAllowedToCalculate
+		{
+			get
+			{
+				return this._IsAllowedToCalculate;
+			}
+			set
+			{
+				if ((this._IsAllowedToCalculate != value))
+				{
+					this.OnIsAllowedToCalculateChanging(value);
+					this.SendPropertyChanging();
+					this._IsAllowedToCalculate = value;
+					this.SendPropertyChanged("IsAllowedToCalculate");
+					this.OnIsAllowedToCalculateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuArchitecture", DbType="VarChar(3)", CanBeNull=false)]
+		public global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture CpuArchitecture
+		{
+			get
+			{
+				return this._CpuArchitecture;
+			}
+			set
+			{
+				if ((this._CpuArchitecture != value))
+				{
+					this.OnCpuArchitectureChanging(value);
+					this.SendPropertyChanging();
+					this._CpuArchitecture = value;
+					this.SendPropertyChanged("CpuArchitecture");
+					this.OnCpuArchitectureChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OperatingSystem", DbType="VarChar(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		public string OperatingSystem
+		{
+			get
+			{
+				return this._OperatingSystem;
+			}
+			set
+			{
+				if ((this._OperatingSystem != value))
+				{
+					this.OnOperatingSystemChanging(value);
+					this.SendPropertyChanging();
+					this._OperatingSystem = value;
+					this.SendPropertyChanged("OperatingSystem");
+					this.OnOperatingSystemChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastHeartbeat", DbType="DateTime")]
+		public System.Nullable<System.DateTime> LastHeartbeat
+		{
+			get
+			{
+				return this._LastHeartbeat;
+			}
+			set
+			{
+				if ((this._LastHeartbeat != value))
+				{
+					this.OnLastHeartbeatChanging(value);
+					this.SendPropertyChanging();
+					this._LastHeartbeat = value;
+					this.SendPropertyChanged("LastHeartbeat");
+					this.OnLastHeartbeatChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuUtilization", DbType="float")]
+		public double CpuUtilization
+		{
+			get
+			{
+				return this._CpuUtilization;
+			}
+			set
+			{
+				if ((this._CpuUtilization != value))
+				{
+					this.OnCpuUtilizationChanging(value);
+					this.SendPropertyChanging();
+					this._CpuUtilization = value;
+					this.SendPropertyChanged("CpuUtilization");
+					this.OnCpuUtilizationChanged();
+				}
+			}
+		}
+	}
+	
+	public partial class SlaveGroup : Resource
+	{
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    #endregion
+		
+		public SlaveGroup()
+		{
+			OnCreated();
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Job")]
+	public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _JobId;
+		
+		private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _State;
+		
+		private double _ExecutionTime;
+		
+		private System.Nullable<System.DateTime> _LastHeartbeat;
+		
+		private System.Nullable<System.Guid> _ParentJobId;
+		
+		private int _Priority;
+		
+		private int _CoresNeeded;
+		
+		private int _MemoryNeeded;
+		
+		private bool _IsParentJob;
+		
+		private bool _FinishWhenChildJobsFinished;
+		
+		private global::HeuristicLab.Services.Hive.Common.DataTransfer.Command? _Command;
+		
+		private System.Guid _HiveExperimentId;
+		
+		private bool _IsPrivileged;
+		
+		private EntitySet<AssignedResource> _AssignedResources;
+		
+		private EntitySet<RequiredPlugin> _RequiredPlugins;
+		
+		private EntitySet<Job> _Jobs;
+		
+		private EntityRef<JobData> _JobData;
+		
+		private EntitySet<StateLog> _StateLogs;
+		
+		private EntityRef<Job> _Job1;
+		
+		private EntityRef<HiveExperiment> _HiveExperiment;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
+    partial void OnStateChanged();
+    partial void OnExecutionTimeMsChanging(double value);
+    partial void OnExecutionTimeMsChanged();
+    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
+    partial void OnLastHeartbeatChanged();
+    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentJobIdChanged();
+    partial void OnPriorityChanging(int value);
+    partial void OnPriorityChanged();
+    partial void OnCoresNeededChanging(int value);
+    partial void OnCoresNeededChanged();
+    partial void OnMemoryNeededChanging(int value);
+    partial void OnMemoryNeededChanged();
+    partial void OnIsParentJobChanging(bool value);
+    partial void OnIsParentJobChanged();
+    partial void OnFinishWhenChildJobsFinishedChanging(bool value);
+    partial void OnFinishWhenChildJobsFinishedChanged();
+    partial void OnCommandChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.Command? value);
+    partial void OnCommandChanged();
+    partial void OnHiveExperimentIdChanging(System.Guid value);
+    partial void OnHiveExperimentIdChanged();
+    partial void OnIsPrivilegedChanging(bool value);
+    partial void OnIsPrivilegedChanged();
+    #endregion
+		
+		public Job()
+		{
+			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
+			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._JobData = default(EntityRef<JobData>);
+			this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
+			this._Job1 = default(EntityRef<Job>);
+			this._HiveExperiment = default(EntityRef<HiveExperiment>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="JobState", Storage="_State", DbType="VarChar(30)", CanBeNull=false)]
+		public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState State
+		{
+			get
+			{
+				return this._State;
+			}
+			set
+			{
+				if ((this._State != value))
+				{
+					this.OnStateChanging(value);
+					this.SendPropertyChanging();
+					this._State = value;
+					this.SendPropertyChanged("State");
+					this.OnStateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float")]
+		public double ExecutionTimeMs
+		{
+			get
+			{
+				return this._ExecutionTime;
+			}
+			set
+			{
+				if ((this._ExecutionTime != value))
+				{
+					this.OnExecutionTimeMsChanging(value);
+					this.SendPropertyChanging();
+					this._ExecutionTime = value;
+					this.SendPropertyChanged("ExecutionTimeMs");
+					this.OnExecutionTimeMsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastHeartbeat", DbType="DateTime")]
+		public System.Nullable<System.DateTime> LastHeartbeat
+		{
+			get
+			{
+				return this._LastHeartbeat;
+			}
+			set
+			{
+				if ((this._LastHeartbeat != value))
+				{
+					this.OnLastHeartbeatChanging(value);
+					this.SendPropertyChanging();
+					this._LastHeartbeat = value;
+					this.SendPropertyChanged("LastHeartbeat");
+					this.OnLastHeartbeatChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentJobId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentJobId
+		{
+			get
+			{
+				return this._ParentJobId;
+			}
+			set
+			{
+				if ((this._ParentJobId != value))
+				{
+					if (this._Job1.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnParentJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentJobId = value;
+					this.SendPropertyChanged("ParentJobId");
+					this.OnParentJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Priority", DbType="Int NOT NULL")]
+		public int Priority
+		{
+			get
+			{
+				return this._Priority;
+			}
+			set
+			{
+				if ((this._Priority != value))
+				{
+					this.OnPriorityChanging(value);
+					this.SendPropertyChanging();
+					this._Priority = value;
+					this.SendPropertyChanged("Priority");
+					this.OnPriorityChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresNeeded", DbType="Int NOT NULL")]
+		public int CoresNeeded
+		{
+			get
+			{
+				return this._CoresNeeded;
+			}
+			set
+			{
+				if ((this._CoresNeeded != value))
+				{
+					this.OnCoresNeededChanging(value);
+					this.SendPropertyChanging();
+					this._CoresNeeded = value;
+					this.SendPropertyChanged("CoresNeeded");
+					this.OnCoresNeededChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MemoryNeeded", DbType="Int NOT NULL")]
+		public int MemoryNeeded
+		{
+			get
+			{
+				return this._MemoryNeeded;
+			}
+			set
+			{
+				if ((this._MemoryNeeded != value))
+				{
+					this.OnMemoryNeededChanging(value);
+					this.SendPropertyChanging();
+					this._MemoryNeeded = value;
+					this.SendPropertyChanged("MemoryNeeded");
+					this.OnMemoryNeededChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsParentJob", DbType="Bit")]
+		public bool IsParentJob
+		{
+			get
+			{
+				return this._IsParentJob;
+			}
+			set
+			{
+				if ((this._IsParentJob != value))
+				{
+					this.OnIsParentJobChanging(value);
+					this.SendPropertyChanging();
+					this._IsParentJob = value;
+					this.SendPropertyChanged("IsParentJob");
+					this.OnIsParentJobChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FinishWhenChildJobsFinished", DbType="Bit")]
+		public bool FinishWhenChildJobsFinished
+		{
+			get
+			{
+				return this._FinishWhenChildJobsFinished;
+			}
+			set
+			{
+				if ((this._FinishWhenChildJobsFinished != value))
+				{
+					this.OnFinishWhenChildJobsFinishedChanging(value);
+					this.SendPropertyChanging();
+					this._FinishWhenChildJobsFinished = value;
+					this.SendPropertyChanged("FinishWhenChildJobsFinished");
+					this.OnFinishWhenChildJobsFinishedChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Command", DbType="VarChar(30)", CanBeNull=true)]
+		public global::HeuristicLab.Services.Hive.Common.DataTransfer.Command? Command
+		{
+			get
+			{
+				return this._Command;
+			}
+			set
+			{
+				if ((this._Command != value))
+				{
+					this.OnCommandChanging(value);
+					this.SendPropertyChanging();
+					this._Command = value;
+					this.SendPropertyChanged("Command");
+					this.OnCommandChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid HiveExperimentId
+		{
+			get
+			{
+				return this._HiveExperimentId;
+			}
+			set
+			{
+				if ((this._HiveExperimentId != value))
+				{
+					if (this._HiveExperiment.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnHiveExperimentIdChanging(value);
+					this.SendPropertyChanging();
+					this._HiveExperimentId = value;
+					this.SendPropertyChanged("HiveExperimentId");
+					this.OnHiveExperimentIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsPrivileged", DbType="Bit")]
+		public bool IsPrivileged
+		{
+			get
+			{
+				return this._IsPrivileged;
+			}
+			set
+			{
+				if ((this._IsPrivileged != value))
+				{
+					this.OnIsPrivilegedChanging(value);
+					this.SendPropertyChanging();
+					this._IsPrivileged = value;
+					this.SendPropertyChanged("IsPrivileged");
+					this.OnIsPrivilegedChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this._AssignedResources;
+			}
+			set
+			{
+				this._AssignedResources.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this._RequiredPlugins;
+			}
+			set
+			{
+				this._RequiredPlugins.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
+		public EntitySet<Job> ChildJobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobData", Storage="_JobData", ThisKey="JobId", OtherKey="JobId", IsUnique=true, IsForeignKey=false)]
+		public JobData JobData
+		{
+			get
+			{
+				return this._JobData.Entity;
+			}
+			set
+			{
+				JobData previousValue = this._JobData.Entity;
+				if (((previousValue != value) 
+							|| (this._JobData.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._JobData.Entity = null;
+						previousValue.Job = null;
+					}
+					this._JobData.Entity = value;
+					if ((value != null))
+					{
+						value.Job = this;
+					}
+					this.SendPropertyChanged("JobData");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_StateLog", Storage="_StateLogs", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<StateLog> StateLogs
+		{
+			get
+			{
+				return this._StateLogs;
+			}
+			set
+			{
+				this._StateLogs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job ParentJob
+		{
+			get
+			{
+				return this._Job1.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job1.Entity;
+				if (((previousValue != value) 
+							|| (this._Job1.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job1.Entity = null;
+						previousValue.ChildJobs.Remove(this);
+					}
+					this._Job1.Entity = value;
+					if ((value != null))
+					{
+						value.ChildJobs.Add(this);
+						this._ParentJobId = value.JobId;
+					}
+					else
+					{
+						this._ParentJobId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("ParentJob");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_Job", Storage="_HiveExperiment", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId", IsForeignKey=true)]
+		public HiveExperiment HiveExperiment
+		{
+			get
+			{
+				return this._HiveExperiment.Entity;
+			}
+			set
+			{
+				HiveExperiment previousValue = this._HiveExperiment.Entity;
+				if (((previousValue != value) 
+							|| (this._HiveExperiment.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HiveExperiment.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._HiveExperiment.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._HiveExperimentId = value.HiveExperimentId;
+					}
+					else
+					{
+						this._HiveExperimentId = default(System.Guid);
+					}
+					this.SendPropertyChanged("HiveExperiment");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.ParentJob = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.ParentJob = null;
+		}
+		
+		private void attach_StateLogs(StateLog entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_StateLogs(StateLog entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Downtime")]
+	public partial class Downtime : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _UptimeCalendarId;
+		
+		private System.Guid _ResourceId;
+		
+		private System.DateTime _StartDate;
+		
+		private System.DateTime _EndDate;
+		
+		private bool _AllDayEvent;
+		
+		private bool _Recurring;
+		
+		private System.Guid _RecurringId;
+		
+		private EntityRef<Resource> _Resource;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnDowntimeIdChanging(System.Guid value);
+    partial void OnDowntimeIdChanged();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnStartDateChanging(System.DateTime value);
+    partial void OnStartDateChanged();
+    partial void OnEndDateChanging(System.DateTime value);
+    partial void OnEndDateChanged();
+    partial void OnAllDayEventChanging(bool value);
+    partial void OnAllDayEventChanged();
+    partial void OnRecurringChanging(bool value);
+    partial void OnRecurringChanged();
+    partial void OnRecurringIdChanging(System.Guid value);
+    partial void OnRecurringIdChanged();
+    #endregion
+		
+		public Downtime()
+		{
+			this._Resource = default(EntityRef<Resource>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid DowntimeId
+		{
+			get
+			{
+				return this._UptimeCalendarId;
+			}
+			set
+			{
+				if ((this._UptimeCalendarId != value))
+				{
+					this.OnDowntimeIdChanging(value);
+					this.SendPropertyChanging();
+					this._UptimeCalendarId = value;
+					this.SendPropertyChanged("DowntimeId");
+					this.OnDowntimeIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier")]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
+		public System.DateTime StartDate
+		{
+			get
+			{
+				return this._StartDate;
+			}
+			set
+			{
+				if ((this._StartDate != value))
+				{
+					this.OnStartDateChanging(value);
+					this.SendPropertyChanging();
+					this._StartDate = value;
+					this.SendPropertyChanged("StartDate");
+					this.OnStartDateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
+		public System.DateTime EndDate
+		{
+			get
+			{
+				return this._EndDate;
+			}
+			set
+			{
+				if ((this._EndDate != value))
+				{
+					this.OnEndDateChanging(value);
+					this.SendPropertyChanging();
+					this._EndDate = value;
+					this.SendPropertyChanged("EndDate");
+					this.OnEndDateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AllDayEvent", DbType="Bit")]
+		public bool AllDayEvent
+		{
+			get
+			{
+				return this._AllDayEvent;
+			}
+			set
+			{
+				if ((this._AllDayEvent != value))
+				{
+					this.OnAllDayEventChanging(value);
+					this.SendPropertyChanging();
+					this._AllDayEvent = value;
+					this.SendPropertyChanged("AllDayEvent");
+					this.OnAllDayEventChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Recurring", DbType="Bit")]
+		public bool Recurring
+		{
+			get
+			{
+				return this._Recurring;
+			}
+			set
+			{
+				if ((this._Recurring != value))
+				{
+					this.OnRecurringChanging(value);
+					this.SendPropertyChanging();
+					this._Recurring = value;
+					this.SendPropertyChanged("Recurring");
+					this.OnRecurringChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RecurringId", DbType="UniqueIdentifier")]
+		public System.Guid RecurringId
+		{
+			get
+			{
+				return this._RecurringId;
+			}
+			set
+			{
+				if ((this._RecurringId != value))
+				{
+					this.OnRecurringIdChanging(value);
+					this.SendPropertyChanging();
+					this._RecurringId = value;
+					this.SendPropertyChanged("RecurringId");
+					this.OnRecurringIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.Downtimes.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.Downtimes.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HiveExperiment")]
+	public partial class HiveExperiment : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _HiveExperimentId;
+		
+		private string _Name;
+		
+		private string _Description;
+		
+		private string _ResourceIds;
+		
+		private System.Guid _UserId;
+		
+		private System.DateTime _DateCreated;
+		
+		private System.Nullable<System.DateTime> _LastAccessed;
+		
+		private bool _IsHiveEngine;
+		
+		private EntitySet<Job> _Jobs;
+		
+		private EntitySet<HiveExperimentPermission> _HiveExperimentPermissions;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnHiveExperimentIdChanging(System.Guid value);
+    partial void OnHiveExperimentIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnDescriptionChanging(string value);
+    partial void OnDescriptionChanged();
+    partial void OnResourceIdsChanging(string value);
+    partial void OnResourceIdsChanged();
+    partial void OnOwnerUserIdChanging(System.Guid value);
+    partial void OnOwnerUserIdChanged();
+    partial void OnDateCreatedChanging(System.DateTime value);
+    partial void OnDateCreatedChanged();
+    partial void OnLastAccessedChanging(System.Nullable<System.DateTime> value);
+    partial void OnLastAccessedChanged();
+    partial void OnIsHiveEngineChanging(bool value);
+    partial void OnIsHiveEngineChanged();
+    #endregion
+		
+		public HiveExperiment()
+		{
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._HiveExperimentPermissions = new EntitySet<HiveExperimentPermission>(new Action<HiveExperimentPermission>(this.attach_HiveExperimentPermissions), new Action<HiveExperimentPermission>(this.detach_HiveExperimentPermissions));
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid HiveExperimentId
+		{
+			get
+			{
+				return this._HiveExperimentId;
+			}
+			set
+			{
+				if ((this._HiveExperimentId != value))
+				{
+					this.OnHiveExperimentIdChanging(value);
+					this.SendPropertyChanging();
+					this._HiveExperimentId = value;
+					this.SendPropertyChanged("HiveExperimentId");
+					this.OnHiveExperimentIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="VarChar(MAX)")]
+		public string Description
+		{
+			get
+			{
+				return this._Description;
+			}
+			set
+			{
+				if ((this._Description != value))
+				{
+					this.OnDescriptionChanging(value);
+					this.SendPropertyChanging();
+					this._Description = value;
+					this.SendPropertyChanged("Description");
+					this.OnDescriptionChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceIds", DbType="VarChar(MAX)")]
+		public string ResourceIds
+		{
+			get
+			{
+				return this._ResourceIds;
+			}
+			set
+			{
+				if ((this._ResourceIds != value))
+				{
+					this.OnResourceIdsChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceIds = value;
+					this.SendPropertyChanged("ResourceIds");
+					this.OnResourceIdsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
+		public System.Guid OwnerUserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnOwnerUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("OwnerUserId");
+					this.OnOwnerUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
+		public System.DateTime DateCreated
+		{
+			get
+			{
+				return this._DateCreated;
+			}
+			set
+			{
+				if ((this._DateCreated != value))
+				{
+					this.OnDateCreatedChanging(value);
+					this.SendPropertyChanging();
+					this._DateCreated = value;
+					this.SendPropertyChanged("DateCreated");
+					this.OnDateCreatedChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastAccessed", DbType="DateTime")]
+		public System.Nullable<System.DateTime> LastAccessed
+		{
+			get
+			{
+				return this._LastAccessed;
+			}
+			set
+			{
+				if ((this._LastAccessed != value))
+				{
+					this.OnLastAccessedChanging(value);
+					this.SendPropertyChanging();
+					this._LastAccessed = value;
+					this.SendPropertyChanged("LastAccessed");
+					this.OnLastAccessedChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsHiveEngine", DbType="Bit")]
+		public bool IsHiveEngine
+		{
+			get
+			{
+				return this._IsHiveEngine;
+			}
+			set
+			{
+				if ((this._IsHiveEngine != value))
+				{
+					this.OnIsHiveEngineChanging(value);
+					this.SendPropertyChanging();
+					this._IsHiveEngine = value;
+					this.SendPropertyChanged("IsHiveEngine");
+					this.OnIsHiveEngineChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_Job", Storage="_Jobs", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId")]
+		public EntitySet<Job> Jobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_HiveExperimentPermission", Storage="_HiveExperimentPermissions", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId")]
+		public EntitySet<HiveExperimentPermission> HiveExperimentPermissions
+		{
+			get
+			{
+				return this._HiveExperimentPermissions;
+			}
+			set
+			{
+				this._HiveExperimentPermissions.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.HiveExperiment = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.HiveExperiment = null;
+		}
+		
+		private void attach_HiveExperimentPermissions(HiveExperimentPermission entity)
+		{
+			this.SendPropertyChanging();
+			entity.HiveExperiment = this;
+		}
+		
+		private void detach_HiveExperimentPermissions(HiveExperimentPermission entity)
+		{
+			this.SendPropertyChanging();
+			entity.HiveExperiment = null;
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.JobData")]
+	public partial class JobData : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _JobId;
+		
+		private System.Data.Linq.Binary _Data;
+		
+		private System.DateTime _LastUpdate;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnDataChanging(System.Data.Linq.Binary value);
+    partial void OnDataChanged();
+    partial void OnLastUpdateChanging(System.DateTime value);
+    partial void OnLastUpdateChanged();
+    #endregion
+		
+		public JobData()
+		{
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="VarBinary(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		public System.Data.Linq.Binary Data
+		{
+			get
+			{
+				return this._Data;
+			}
+			set
+			{
+				if ((this._Data != value))
+				{
+					this.OnDataChanging(value);
+					this.SendPropertyChanging();
+					this._Data = value;
+					this.SendPropertyChanged("Data");
+					this.OnDataChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastUpdate", DbType="DateTime")]
+		public System.DateTime LastUpdate
+		{
+			get
+			{
+				return this._LastUpdate;
+			}
+			set
+			{
+				if ((this._LastUpdate != value))
+				{
+					this.OnLastUpdateChanging(value);
+					this.SendPropertyChanging();
+					this._LastUpdate = value;
+					this.SendPropertyChanged("LastUpdate");
+					this.OnLastUpdateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobData", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.JobData = null;
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.JobData = this;
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PluginData")]
+	public partial class PluginData : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _PluginDataId;
+		
+		private System.Guid _PluginId;
+		
+		private System.Data.Linq.Binary _Data;
+		
+		private string _FileName;
+		
+		private EntityRef<Plugin> _Plugin;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnPluginDataIdChanging(System.Guid value);
+    partial void OnPluginDataIdChanged();
+    partial void OnPluginIdChanging(System.Guid value);
+    partial void OnPluginIdChanged();
+    partial void OnDataChanging(System.Data.Linq.Binary value);
+    partial void OnDataChanged();
+    partial void OnFileNameChanging(string value);
+    partial void OnFileNameChanged();
+    #endregion
+		
+		public PluginData()
+		{
+			this._Plugin = default(EntityRef<Plugin>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginDataId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid PluginDataId
+		{
+			get
+			{
+				return this._PluginDataId;
+			}
+			set
+			{
+				if ((this._PluginDataId != value))
+				{
+					this.OnPluginDataIdChanging(value);
+					this.SendPropertyChanging();
+					this._PluginDataId = value;
+					this.SendPropertyChanged("PluginDataId");
+					this.OnPluginDataIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid PluginId
+		{
+			get
+			{
+				return this._PluginId;
+			}
+			set
+			{
+				if ((this._PluginId != value))
+				{
+					if (this._Plugin.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._PluginId = value;
+					this.SendPropertyChanged("PluginId");
+					this.OnPluginIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="VarBinary(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		public System.Data.Linq.Binary Data
+		{
+			get
+			{
+				return this._Data;
+			}
+			set
+			{
+				if ((this._Data != value))
+				{
+					this.OnDataChanging(value);
+					this.SendPropertyChanging();
+					this._Data = value;
+					this.SendPropertyChanged("Data");
+					this.OnDataChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FileName", DbType="VarChar(MAX)", CanBeNull=false)]
+		public string FileName
+		{
+			get
+			{
+				return this._FileName;
+			}
+			set
+			{
+				if ((this._FileName != value))
+				{
+					this.OnFileNameChanging(value);
+					this.SendPropertyChanging();
+					this._FileName = value;
+					this.SendPropertyChanged("FileName");
+					this.OnFileNameChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_Plugin", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true)]
+		public Plugin Plugin
+		{
+			get
+			{
+				return this._Plugin.Entity;
+			}
+			set
+			{
+				Plugin previousValue = this._Plugin.Entity;
+				if (((previousValue != value) 
+							|| (this._Plugin.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Plugin.Entity = null;
+						previousValue.PluginData.Remove(this);
+					}
+					this._Plugin.Entity = value;
+					if ((value != null))
+					{
+						value.PluginData.Add(this);
+						this._PluginId = value.PluginId;
+					}
+					else
+					{
+						this._PluginId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Plugin");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.StateLog")]
+	public partial class StateLog : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _StateLogId;
+		
+		private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _State;
+		
+		private System.DateTime _DateTime;
+		
+		private System.Guid _JobId;
+		
+		private System.Nullable<System.Guid> _UserId;
+		
+		private System.Nullable<System.Guid> _SlaveId;
+		
+		private string _Exception;
+		
+		private EntityRef<Job> _Job;
+		
+		private EntityRef<Resource> _Resource;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnStateLogIdChanging(System.Guid value);
+    partial void OnStateLogIdChanged();
+    partial void OnStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
+    partial void OnStateChanged();
+    partial void OnDateTimeChanging(System.DateTime value);
+    partial void OnDateTimeChanged();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
+    partial void OnUserIdChanged();
+    partial void OnSlaveIdChanging(System.Nullable<System.Guid> value);
+    partial void OnSlaveIdChanged();
+    partial void OnExceptionChanging(string value);
+    partial void OnExceptionChanged();
+    #endregion
+		
+		public StateLog()
+		{
+			this._Job = default(EntityRef<Job>);
+			this._Resource = default(EntityRef<Resource>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StateLogId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid StateLogId
+		{
+			get
+			{
+				return this._StateLogId;
+			}
+			set
+			{
+				if ((this._StateLogId != value))
+				{
+					this.OnStateLogIdChanging(value);
+					this.SendPropertyChanging();
+					this._StateLogId = value;
+					this.SendPropertyChanged("StateLogId");
+					this.OnStateLogIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="VarChar(30) NOT NULL", CanBeNull=false)]
+		public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState State
+		{
+			get
+			{
+				return this._State;
+			}
+			set
+			{
+				if ((this._State != value))
+				{
+					this.OnStateChanging(value);
+					this.SendPropertyChanging();
+					this._State = value;
+					this.SendPropertyChanged("State");
+					this.OnStateChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateTime", DbType="DateTime NOT NULL")]
+		public System.DateTime DateTime
+		{
+			get
+			{
+				return this._DateTime;
+			}
+			set
+			{
+				if ((this._DateTime != value))
+				{
+					this.OnDateTimeChanging(value);
+					this.SendPropertyChanging();
+					this._DateTime = value;
+					this.SendPropertyChanged("DateTime");
+					this.OnDateTimeChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> UserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("UserId");
+					this.OnUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> SlaveId
+		{
+			get
+			{
+				return this._SlaveId;
+			}
+			set
+			{
+				if ((this._SlaveId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnSlaveIdChanging(value);
+					this.SendPropertyChanging();
+					this._SlaveId = value;
+					this.SendPropertyChanged("SlaveId");
+					this.OnSlaveIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="VarChar(MAX)", CanBeNull=false)]
+		public string Exception
+		{
+			get
+			{
+				return this._Exception;
+			}
+			set
+			{
+				if ((this._Exception != value))
+				{
+					this.OnExceptionChanging(value);
+					this.SendPropertyChanging();
+					this._Exception = value;
+					this.SendPropertyChanged("Exception");
+					this.OnExceptionChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_StateLog", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.StateLogs.Remove(this);
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.StateLogs.Add(this);
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_StateLog", Storage="_Resource", ThisKey="SlaveId", OtherKey="ResourceId", IsForeignKey=true)]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.StateLogs.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.StateLogs.Add(this);
+						this._SlaveId = value.ResourceId;
+					}
+					else
+					{
+						this._SlaveId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HiveExperimentPermission")]
+	public partial class HiveExperimentPermission : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _HiveExperimentId;
+		
+		private System.Guid _GrantedUserId;
+		
+		private System.Guid _GrantedByUserId;
+		
+		private global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission _Permission;
+		
+		private EntityRef<HiveExperiment> _HiveExperiment;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnHiveExperimentIdChanging(System.Guid value);
+    partial void OnHiveExperimentIdChanged();
+    partial void OnGrantedUserIdChanging(System.Guid value);
+    partial void OnGrantedUserIdChanged();
+    partial void OnGrantedByUserIdChanging(System.Guid value);
+    partial void OnGrantedByUserIdChanged();
+    partial void OnPermissionChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission value);
+    partial void OnPermissionChanged();
+    #endregion
+		
+		public HiveExperimentPermission()
+		{
+			this._HiveExperiment = default(EntityRef<HiveExperiment>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid HiveExperimentId
+		{
+			get
+			{
+				return this._HiveExperimentId;
+			}
+			set
+			{
+				if ((this._HiveExperimentId != value))
+				{
+					if (this._HiveExperiment.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnHiveExperimentIdChanging(value);
+					this.SendPropertyChanging();
+					this._HiveExperimentId = value;
+					this.SendPropertyChanged("HiveExperimentId");
+					this.OnHiveExperimentIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid GrantedUserId
+		{
+			get
+			{
+				return this._GrantedUserId;
+			}
+			set
+			{
+				if ((this._GrantedUserId != value))
+				{
+					this.OnGrantedUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._GrantedUserId = value;
+					this.SendPropertyChanged("GrantedUserId");
+					this.OnGrantedUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid GrantedByUserId
+		{
+			get
+			{
+				return this._GrantedByUserId;
+			}
+			set
+			{
+				if ((this._GrantedByUserId != value))
+				{
+					this.OnGrantedByUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._GrantedByUserId = value;
+					this.SendPropertyChanged("GrantedByUserId");
+					this.OnGrantedByUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Permission", DbType="VarChar(15) NOT NULL", CanBeNull=false)]
+		public global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission Permission
+		{
+			get
+			{
+				return this._Permission;
+			}
+			set
+			{
+				if ((this._Permission != value))
+				{
+					this.OnPermissionChanging(value);
+					this.SendPropertyChanging();
+					this._Permission = value;
+					this.SendPropertyChanged("Permission");
+					this.OnPermissionChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_HiveExperimentPermission", Storage="_HiveExperiment", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId", IsForeignKey=true)]
+		public HiveExperiment HiveExperiment
+		{
+			get
+			{
+				return this._HiveExperiment.Entity;
+			}
+			set
+			{
+				HiveExperiment previousValue = this._HiveExperiment.Entity;
+				if (((previousValue != value) 
+							|| (this._HiveExperiment.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HiveExperiment.Entity = null;
+						previousValue.HiveExperimentPermissions.Remove(this);
+					}
+					this._HiveExperiment.Entity = value;
+					if ((value != null))
+					{
+						value.HiveExperimentPermissions.Add(this);
+						this._HiveExperimentId = value.HiveExperimentId;
+					}
+					else
+					{
+						this._HiveExperimentId = default(System.Guid);
+					}
+					this.SendPropertyChanged("HiveExperiment");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class Lifecycle : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private int _LifecycleId;
+		
+		private System.DateTime _LastCleanup;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnLifecycleIdChanging(int value);
+    partial void OnLifecycleIdChanged();
+    partial void OnLastCleanupChanging(System.DateTime value);
+    partial void OnLastCleanupChanged();
+    #endregion
+		
+		public Lifecycle()
+		{
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LifecycleId", DbType="Int", IsPrimaryKey=true)]
+		public int LifecycleId
+		{
+			get
+			{
+				return this._LifecycleId;
+			}
+			set
+			{
+				if ((this._LifecycleId != value))
+				{
+					this.OnLifecycleIdChanging(value);
+					this.SendPropertyChanging();
+					this._LifecycleId = value;
+					this.SendPropertyChanged("LifecycleId");
+					this.OnLifecycleIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastCleanup", DbType="DateTime")]
+		public System.DateTime LastCleanup
+		{
+			get
+			{
+				return this._LastCleanup;
+			}
+			set
+			{
+				if ((this._LastCleanup != value))
+				{
+					this.OnLastCleanupChanging(value);
+					this.SendPropertyChanging();
+					this._LastCleanup = value;
+					this.SendPropertyChanged("LastCleanup");
+					this.OnLastCleanupChanged();
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class DeletedJobStatistics : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _UserId;
+		
+		private double _ExecutionTime;
+		
+		private double _ExecutionTimeFinishedJobs;
+		
+		private double _StartToEndTime;
+		
+		private System.Guid _DeletedJobStatisticsId;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnUserIdChanging(System.Guid value);
+    partial void OnUserIdChanged();
+    partial void OnExecutionTimeMsChanging(double value);
+    partial void OnExecutionTimeMsChanged();
+    partial void OnExecutionTimeMsFinishedJobsChanging(double value);
+    partial void OnExecutionTimeMsFinishedJobsChanged();
+    partial void OnStartToEndTimeMsChanging(double value);
+    partial void OnStartToEndTimeMsChanged();
+    partial void OnDeletedJobStatisticsIdChanging(System.Guid value);
+    partial void OnDeletedJobStatisticsIdChanged();
+    #endregion
+		
+		public DeletedJobStatistics()
+		{
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid UserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("UserId");
+					this.OnUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float NOT NULL")]
+		public double ExecutionTimeMs
+		{
+			get
+			{
+				return this._ExecutionTime;
+			}
+			set
+			{
+				if ((this._ExecutionTime != value))
+				{
+					this.OnExecutionTimeMsChanging(value);
+					this.SendPropertyChanging();
+					this._ExecutionTime = value;
+					this.SendPropertyChanged("ExecutionTimeMs");
+					this.OnExecutionTimeMsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTimeFinishedJobs", DbType="float NOT NULL")]
+		public double ExecutionTimeMsFinishedJobs
+		{
+			get
+			{
+				return this._ExecutionTimeFinishedJobs;
+			}
+			set
+			{
+				if ((this._ExecutionTimeFinishedJobs != value))
+				{
+					this.OnExecutionTimeMsFinishedJobsChanging(value);
+					this.SendPropertyChanging();
+					this._ExecutionTimeFinishedJobs = value;
+					this.SendPropertyChanged("ExecutionTimeMsFinishedJobs");
+					this.OnExecutionTimeMsFinishedJobsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartToEndTime", DbType="float NOT NULL")]
+		public double StartToEndTimeMs
+		{
+			get
+			{
+				return this._StartToEndTime;
+			}
+			set
+			{
+				if ((this._StartToEndTime != value))
+				{
+					this.OnStartToEndTimeMsChanging(value);
+					this.SendPropertyChanging();
+					this._StartToEndTime = value;
+					this.SendPropertyChanged("StartToEndTimeMs");
+					this.OnStartToEndTimeMsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DeletedJobStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid DeletedJobStatisticsId
+		{
+			get
+			{
+				return this._DeletedJobStatisticsId;
+			}
+			set
+			{
+				if ((this._DeletedJobStatisticsId != value))
+				{
+					this.OnDeletedJobStatisticsIdChanging(value);
+					this.SendPropertyChanging();
+					this._DeletedJobStatisticsId = value;
+					this.SendPropertyChanged("DeletedJobStatisticsId");
+					this.OnDeletedJobStatisticsIdChanged();
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class UserStatistics : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _StatisticsId;
+		
+		private System.Guid _UserId;
+		
+		private double _ExecutionTime;
+		
+		private int _CoresUsed;
+		
+		private double _ExecutionTimeFinishedJobs;
+		
+		private double _StartToEndTime;
+		
+		private EntityRef<Statistics> _Statistics;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnStatisticsIdChanging(System.Guid value);
+    partial void OnStatisticsIdChanged();
+    partial void OnUserIdChanging(System.Guid value);
+    partial void OnUserIdChanged();
+    partial void OnExecutionTimeMsChanging(double value);
+    partial void OnExecutionTimeMsChanged();
+    partial void OnUsedCoresChanging(int value);
+    partial void OnUsedCoresChanged();
+    partial void OnExecutionTimeMsFinishedJobsChanging(double value);
+    partial void OnExecutionTimeMsFinishedJobsChanged();
+    partial void OnStartToEndTimeMsChanging(double value);
+    partial void OnStartToEndTimeMsChanged();
+    #endregion
+		
+		public UserStatistics()
+		{
+			this._Statistics = default(EntityRef<Statistics>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid StatisticsId
+		{
+			get
+			{
+				return this._StatisticsId;
+			}
+			set
+			{
+				if ((this._StatisticsId != value))
+				{
+					if (this._Statistics.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnStatisticsIdChanging(value);
+					this.SendPropertyChanging();
+					this._StatisticsId = value;
+					this.SendPropertyChanged("StatisticsId");
+					this.OnStatisticsIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid UserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("UserId");
+					this.OnUserIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float NOT NULL")]
+		public double ExecutionTimeMs
+		{
+			get
+			{
+				return this._ExecutionTime;
+			}
+			set
+			{
+				if ((this._ExecutionTime != value))
+				{
+					this.OnExecutionTimeMsChanging(value);
+					this.SendPropertyChanging();
+					this._ExecutionTime = value;
+					this.SendPropertyChanged("ExecutionTimeMs");
+					this.OnExecutionTimeMsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresUsed", DbType="Int NOT NULL")]
+		public int UsedCores
+		{
+			get
+			{
+				return this._CoresUsed;
+			}
+			set
+			{
+				if ((this._CoresUsed != value))
+				{
+					this.OnUsedCoresChanging(value);
+					this.SendPropertyChanging();
+					this._CoresUsed = value;
+					this.SendPropertyChanged("UsedCores");
+					this.OnUsedCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTimeFinishedJobs", DbType="float NOT NULL")]
+		public double ExecutionTimeMsFinishedJobs
+		{
+			get
+			{
+				return this._ExecutionTimeFinishedJobs;
+			}
+			set
+			{
+				if ((this._ExecutionTimeFinishedJobs != value))
+				{
+					this.OnExecutionTimeMsFinishedJobsChanging(value);
+					this.SendPropertyChanging();
+					this._ExecutionTimeFinishedJobs = value;
+					this.SendPropertyChanged("ExecutionTimeMsFinishedJobs");
+					this.OnExecutionTimeMsFinishedJobsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartToEndTime", DbType="float NOT NULL")]
+		public double StartToEndTimeMs
+		{
+			get
+			{
+				return this._StartToEndTime;
+			}
+			set
+			{
+				if ((this._StartToEndTime != value))
+				{
+					this.OnStartToEndTimeMsChanging(value);
+					this.SendPropertyChanging();
+					this._StartToEndTime = value;
+					this.SendPropertyChanged("StartToEndTimeMs");
+					this.OnStartToEndTimeMsChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_UserStatistics", Storage="_Statistics", ThisKey="StatisticsId", OtherKey="StatisticsId", IsForeignKey=true)]
+		public Statistics Statistics
+		{
+			get
+			{
+				return this._Statistics.Entity;
+			}
+			set
+			{
+				Statistics previousValue = this._Statistics.Entity;
+				if (((previousValue != value) 
+							|| (this._Statistics.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Statistics.Entity = null;
+						previousValue.UserStatistics.Remove(this);
+					}
+					this._Statistics.Entity = value;
+					if ((value != null))
+					{
+						value.UserStatistics.Add(this);
+						this._StatisticsId = value.StatisticsId;
+					}
+					else
+					{
+						this._StatisticsId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Statistics");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class SlaveStatistics : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _StatisticsId;
+		
+		private System.Guid _SlaveId;
+		
+		private int _Cores;
+		
+		private int _FreeCores;
+		
+		private double _CpuUtilization;
+		
+		private int _Memory;
+		
+		private int _FreeMemory;
+		
+		private EntityRef<Statistics> _Statistics;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnStatisticsIdChanging(System.Guid value);
+    partial void OnStatisticsIdChanged();
+    partial void OnSlaveIdChanging(System.Guid value);
+    partial void OnSlaveIdChanged();
+    partial void OnCoresChanging(int value);
+    partial void OnCoresChanged();
+    partial void OnFreeCoresChanging(int value);
+    partial void OnFreeCoresChanged();
+    partial void OnCpuUtilizationChanging(double value);
+    partial void OnCpuUtilizationChanged();
+    partial void OnMemoryChanging(int value);
+    partial void OnMemoryChanged();
+    partial void OnFreeMemoryChanging(int value);
+    partial void OnFreeMemoryChanged();
+    #endregion
+		
+		public SlaveStatistics()
+		{
+			this._Statistics = default(EntityRef<Statistics>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid StatisticsId
+		{
+			get
+			{
+				return this._StatisticsId;
+			}
+			set
+			{
+				if ((this._StatisticsId != value))
+				{
+					if (this._Statistics.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnStatisticsIdChanging(value);
+					this.SendPropertyChanging();
+					this._StatisticsId = value;
+					this.SendPropertyChanged("StatisticsId");
+					this.OnStatisticsIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid SlaveId
+		{
+			get
+			{
+				return this._SlaveId;
+			}
+			set
+			{
+				if ((this._SlaveId != value))
+				{
+					this.OnSlaveIdChanging(value);
+					this.SendPropertyChanging();
+					this._SlaveId = value;
+					this.SendPropertyChanged("SlaveId");
+					this.OnSlaveIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Cores", DbType="Int NOT NULL")]
+		public int Cores
+		{
+			get
+			{
+				return this._Cores;
+			}
+			set
+			{
+				if ((this._Cores != value))
+				{
+					this.OnCoresChanging(value);
+					this.SendPropertyChanging();
+					this._Cores = value;
+					this.SendPropertyChanged("Cores");
+					this.OnCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeCores", DbType="Int NOT NULL")]
+		public int FreeCores
+		{
+			get
+			{
+				return this._FreeCores;
+			}
+			set
+			{
+				if ((this._FreeCores != value))
+				{
+					this.OnFreeCoresChanging(value);
+					this.SendPropertyChanging();
+					this._FreeCores = value;
+					this.SendPropertyChanged("FreeCores");
+					this.OnFreeCoresChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuUtilization", DbType="float NOT NULL")]
+		public double CpuUtilization
+		{
+			get
+			{
+				return this._CpuUtilization;
+			}
+			set
+			{
+				if ((this._CpuUtilization != value))
+				{
+					this.OnCpuUtilizationChanging(value);
+					this.SendPropertyChanging();
+					this._CpuUtilization = value;
+					this.SendPropertyChanged("CpuUtilization");
+					this.OnCpuUtilizationChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Memory", DbType="Int NOT NULL")]
+		public int Memory
+		{
+			get
+			{
+				return this._Memory;
+			}
+			set
+			{
+				if ((this._Memory != value))
+				{
+					this.OnMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._Memory = value;
+					this.SendPropertyChanged("Memory");
+					this.OnMemoryChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeMemory", DbType="Int NOT NULL")]
+		public int FreeMemory
+		{
+			get
+			{
+				return this._FreeMemory;
+			}
+			set
+			{
+				if ((this._FreeMemory != value))
+				{
+					this.OnFreeMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._FreeMemory = value;
+					this.SendPropertyChanged("FreeMemory");
+					this.OnFreeMemoryChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_SlaveStatistics", Storage="_Statistics", ThisKey="StatisticsId", OtherKey="StatisticsId", IsForeignKey=true)]
+		public Statistics Statistics
+		{
+			get
+			{
+				return this._Statistics.Entity;
+			}
+			set
+			{
+				Statistics previousValue = this._Statistics.Entity;
+				if (((previousValue != value) 
+							|| (this._Statistics.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Statistics.Entity = null;
+						previousValue.SlaveStatistics.Remove(this);
+					}
+					this._Statistics.Entity = value;
+					if ((value != null))
+					{
+						value.SlaveStatistics.Add(this);
+						this._StatisticsId = value.StatisticsId;
+					}
+					else
+					{
+						this._StatisticsId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Statistics");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class Statistics : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _StatisticsId;
+		
+		private System.DateTime _Timestamp;
+		
+		private EntitySet<UserStatistics> _UserStatistics;
+		
+		private EntitySet<SlaveStatistics> _SlaveStatistics;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnStatisticsIdChanging(System.Guid value);
+    partial void OnStatisticsIdChanged();
+    partial void OnTimestampChanging(System.DateTime value);
+    partial void OnTimestampChanged();
+    #endregion
+		
+		public Statistics()
+		{
+			this._UserStatistics = new EntitySet<UserStatistics>(new Action<UserStatistics>(this.attach_UserStatistics), new Action<UserStatistics>(this.detach_UserStatistics));
+			this._SlaveStatistics = new EntitySet<SlaveStatistics>(new Action<SlaveStatistics>(this.attach_SlaveStatistics), new Action<SlaveStatistics>(this.detach_SlaveStatistics));
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid StatisticsId
+		{
+			get
+			{
+				return this._StatisticsId;
+			}
+			set
+			{
+				if ((this._StatisticsId != value))
+				{
+					this.OnStatisticsIdChanging(value);
+					this.SendPropertyChanging();
+					this._StatisticsId = value;
+					this.SendPropertyChanged("StatisticsId");
+					this.OnStatisticsIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Timestamp")]
+		public System.DateTime Timestamp
+		{
+			get
+			{
+				return this._Timestamp;
+			}
+			set
+			{
+				if ((this._Timestamp != value))
+				{
+					this.OnTimestampChanging(value);
+					this.SendPropertyChanging();
+					this._Timestamp = value;
+					this.SendPropertyChanged("Timestamp");
+					this.OnTimestampChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_UserStatistics", Storage="_UserStatistics", ThisKey="StatisticsId", OtherKey="StatisticsId")]
+		public EntitySet<UserStatistics> UserStatistics
+		{
+			get
+			{
+				return this._UserStatistics;
+			}
+			set
+			{
+				this._UserStatistics.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_SlaveStatistics", Storage="_SlaveStatistics", ThisKey="StatisticsId", OtherKey="StatisticsId")]
+		public EntitySet<SlaveStatistics> SlaveStatistics
+		{
+			get
+			{
+				return this._SlaveStatistics;
+			}
+			set
+			{
+				this._SlaveStatistics.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_UserStatistics(UserStatistics entity)
+		{
+			this.SendPropertyChanging();
+			entity.Statistics = this;
+		}
+		
+		private void detach_UserStatistics(UserStatistics entity)
+		{
+			this.SendPropertyChanging();
+			entity.Statistics = null;
+		}
+		
+		private void attach_SlaveStatistics(SlaveStatistics entity)
+		{
+			this.SendPropertyChanging();
+			entity.Statistics = this;
+		}
+		
+		private void detach_SlaveStatistics(SlaveStatistics entity)
+		{
+			this.SendPropertyChanging();
+			entity.Statistics = null;
+		}
+	}
+}
+#pragma warning restore 1591
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs	(revision 6701)
@@ -0,0 +1,149 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using HeuristicLab.Services.Hive.Common.DataTransfer;
+using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  public interface IHiveDao {
+    #region Job Methods
+    DT.Job GetJob(Guid id);
+    IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate);
+    Guid AddJob(DT.Job dto);
+    void UpdateJob(DT.Job dto);
+    void DeleteJob(Guid id);
+    IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave, int count);
+    IEnumerable<DT.Job> GetParentJobs(IEnumerable<Guid> resourceIds, int count, bool finished);
+    DT.Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception);
+    #endregion
+
+    #region JobData Methods
+    DT.JobData GetJobData(Guid id);
+    IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate);
+    Guid AddJobData(DT.JobData dto);
+    void UpdateJobData(DT.JobData dto);
+    void DeleteJobData(Guid id);
+    #endregion
+
+    #region StateLog Methods
+    DT.StateLog GetStateLog(Guid id);
+    IEnumerable<DT.StateLog> GetStateLogs(Expression<Func<StateLog, bool>> predicate);
+    Guid AddStateLog(DT.StateLog dto);
+    void UpdateStateLog(DT.StateLog dto);
+    void DeleteStateLog(Guid id);
+    #endregion
+
+    #region HiveExperiment Methods
+    DT.HiveExperiment GetHiveExperiment(Guid id);
+    IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate);
+    Guid AddHiveExperiment(DT.HiveExperiment dto);
+    void UpdateHiveExperiment(DT.HiveExperiment dto);
+    void DeleteHiveExperiment(Guid id);
+    #endregion
+
+    #region HiveExperimentPermission Methods
+    DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
+    IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate);
+    void AddHiveExperimentPermission(DT.HiveExperimentPermission dto);
+    void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto);
+    void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
+    void SetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedByUserId, Guid grantedUserId, Permission permission);
+    #endregion
+
+    #region Plugin Methods
+    DT.Plugin GetPlugin(Guid id);
+    IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate);
+    Guid AddPlugin(DT.Plugin dto);
+    void UpdatePlugin(DT.Plugin dto);
+    void DeletePlugin(Guid id);
+    #endregion
+
+    #region PluginData Methods
+    DT.PluginData GetPluginData(Guid id);
+    IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate);
+    Guid AddPluginData(DT.PluginData dto);
+    void UpdatePluginData(DT.PluginData dto);
+    void DeletePluginData(Guid id);
+    #endregion
+
+    #region Calendar Methods
+    #endregion
+
+    #region Slave Methods
+    DT.Slave GetSlave(Guid id);
+    IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate);
+    Guid AddSlave(DT.Slave dto);
+    void UpdateSlave(DT.Slave dto);
+    void DeleteSlave(Guid id);
+    #endregion
+
+    #region SlaveGroup Methods
+    DT.SlaveGroup GetSlaveGroup(Guid id);
+    IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate);
+    Guid AddSlaveGroup(DT.SlaveGroup dto);
+    void UpdateSlaveGroup(DT.SlaveGroup dto);
+    void DeleteSlaveGroup(Guid id);
+    #endregion
+
+    #region Resource Methods
+    DT.Resource GetResource(Guid id);
+    IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate);
+    Guid AddResource(DT.Resource dto);
+    void UpdateResource(DT.Resource dto);
+    void DeleteResource(Guid id);
+    void AssignJobToResource(Guid jobId, Guid resourceId);
+    IEnumerable<DT.Resource> GetAssignedResources(Guid jobId);
+    IEnumerable<DT.Resource> GetParentResources(Guid resourceId);
+    IEnumerable<DT.Resource> GetChildResources(Guid resourceId);
+    IEnumerable<DT.Job> GetJobsByResourceId(Guid resourceId);
+    #endregion
+
+    #region Authorization Methods
+    Permission GetPermissionForJob(Guid jobId, Guid userId);
+    Permission GetPermissionForExperiment(Guid experimentId, Guid userId);
+    Guid GetExperimentForJob(Guid jobId);
+    #endregion
+
+    #region Lifecycle Methods
+    DateTime GetLastCleanup();
+    void SetLastCleanup(DateTime datetime);
+    #endregion
+
+    #region Downtime Methods
+    DT.Downtime GetDowntime(Guid id);
+    IEnumerable<DT.Downtime> GetDowntimes(Expression<Func<Downtime, bool>> predicate);
+    Guid AddDowntime(DT.Downtime dto);
+    void UpdateDowntime(DT.Downtime dto);
+    void DeleteDowntime(Guid id);
+    #endregion
+
+    #region Statistics Methods
+    DT.Statistics GetStatistic(Guid id);
+    IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate);
+    Guid AddStatistics(DT.Statistics dto);
+    void DeleteStatistics(Guid id);
+    List<DT.UserStatistics> GetUserStatistics();
+    #endregion
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/AssemblyInfo.cs.frame	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/AssemblyInfo.cs.frame	(revision 6701)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Services.Hive.Server.DataAccess")]
+[assembly: AssemblyDescription("Data access layer for HeuristicLab.Hive database")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2011 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("38842322-b8e5-47aa-8e86-4a6bdd96d53e")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.5.0")]
+[assembly: AssemblyFileVersion("3.3.5.$WCREV$")]
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/Settings.Designer.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/Settings.Designer.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/Settings.Designer.cs	(revision 6701)
@@ -0,0 +1,37 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.1
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Services.Hive.DataAccess.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=T" +
+            "rue;")]
+        public string HeuristicLab_Hive_LinqConnectionString {
+            get {
+                return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
+            }
+        }
+    }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/Settings.settings
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/Settings.settings	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Properties/Settings.settings	(revision 6701)
@@ -0,0 +1,14 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Services.Hive.DataAccess.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
+      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;ConnectionString&gt;Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;&lt;/ConnectionString&gt;
+  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+      <Value Profile="(Default)">Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql	(revision 6701)
@@ -0,0 +1,178 @@
+﻿USE [HeuristicLab.Hive-3.4]
+/* create and initialize hive database tables */
+
+SET ARITHABORT ON
+CREATE TABLE [dbo].[AssignedResources](
+  [ResourceId] UniqueIdentifier NOT NULL, 
+  [JobId] UniqueIdentifier NOT NULL,   
+  CONSTRAINT [PK_dbo.ResourceId] PRIMARY KEY ([ResourceId]),
+  CONSTRAINT [PK_dbo.JobId] PRIMARY KEY ([JobId])
+  )
+CREATE TABLE [dbo].[Plugin](
+  [PluginId] UniqueIdentifier NOT NULL, 
+  [Name] VarChar(MAX), 
+  [Version] VarChar(MAX), 
+  [UserId] UniqueIdentifier, 
+  [DateCreated] DateTime, 
+  [Hash] VarBinary(20), 
+  CONSTRAINT [PK_dbo.Plugin] PRIMARY KEY ([PluginId])
+  )
+CREATE TABLE [dbo].[RequiredPlugins](
+  [RequiredPluginId] UniqueIdentifier NOT NULL, 
+  [JobId] UniqueIdentifier NOT NULL, 
+  [PluginId] UniqueIdentifier NOT NULL, 
+  CONSTRAINT [PK_dbo.RequiredPlugins] PRIMARY KEY ([RequiredPluginId])
+  )
+CREATE TABLE [dbo].[Resource](
+  [ResourceId] UniqueIdentifier NOT NULL, 
+  [Name] VarChar(MAX), 
+  [ResourceType] NVarChar(4000) NOT NULL, 
+  [ParentResourceId] UniqueIdentifier, 
+  [CpuSpeed] Int, 
+  [Memory] Int, 
+  [Login] DateTime, 
+  [SlaveState] VarChar(15), 
+  [Cores] Int, 
+  [FreeCores] Int, 
+  [FreeMemory] Int, 
+  [IsAllowedToCalculate] Bit, 
+  [CpuArchitecture] VarChar(3), 
+  [OperatingSystem] VarChar(MAX), 
+  [LastHeartbeat] DateTime, 
+  [CpuUtilization] float, 
+  CONSTRAINT [PK_dbo.Resource] PRIMARY KEY ([ResourceId])
+  )
+CREATE TABLE [dbo].[Job](
+  [JobId] UniqueIdentifier NOT NULL, 
+  [JobState] VarChar(30), 
+  [ExecutionTimeMs] float, 
+  [LastHeartbeat] DateTime, 
+  [ParentJobId] UniqueIdentifier, 
+  [Priority] Int NOT NULL, 
+  [CoresNeeded] Int NOT NULL, 
+  [MemoryNeeded] Int NOT NULL, 
+  [IsParentJob] Bit, 
+  [FinishWhenChildJobsFinished] Bit, 
+  [Command] VarChar(30), 
+  [HiveExperimentId] UniqueIdentifier NOT NULL, 
+  [IsPrivileged] Bit, 
+  CONSTRAINT [PK_dbo.Job] PRIMARY KEY ([JobId])
+  )
+CREATE TABLE [dbo].[UptimeCalendar](
+  [UptimeCalendarId] UniqueIdentifier, 
+  [ResourceId] UniqueIdentifier, 
+  [StartDate] DateTime, 
+  [EndDate] DateTime, 
+  [AllDayEvent] Bit, 
+  [Recurring] Bit, 
+  [RecurringId] UniqueIdentifier, 
+  CONSTRAINT [PK_dbo.UptimeCalendar] PRIMARY KEY ([UptimeCalendarId])
+  )
+CREATE TABLE [dbo].[HiveExperiment](
+  [HiveExperimentId] UniqueIdentifier NOT NULL, 
+  [Name] VarChar(MAX), 
+  [Description] VarChar(MAX), 
+  [ResourceIds] VarChar(MAX), 
+  [OwnerUserId] UniqueIdentifier, 
+  [DateCreated] DateTime, 
+  [LastAccessed] DateTime, 
+  [IsHiveEngine] Bit, 
+  CONSTRAINT [PK_dbo.HiveExperiment] PRIMARY KEY ([HiveExperimentId])
+  )
+CREATE TABLE [dbo].[JobData](
+  [JobId] UniqueIdentifier NOT NULL, 
+  [Data] VarBinary(MAX), 
+  [LastUpdate] DateTime, 
+  CONSTRAINT [PK_dbo.JobData] PRIMARY KEY ([JobId])
+  )
+CREATE TABLE [dbo].[PluginData](
+  [PluginDataId] UniqueIdentifier NOT NULL, 
+  [PluginId] UniqueIdentifier NOT NULL, 
+  [Data] VarBinary(MAX) NOT NULL, 
+  [FileName] VarChar(MAX), 
+  CONSTRAINT [PK_dbo.PluginData] PRIMARY KEY ([PluginDataId])
+  )
+CREATE TABLE [dbo].[StateLog](
+  [StateLogId] UniqueIdentifier NOT NULL, 
+  [State] VarChar(30) NOT NULL, 
+  [DateTime] DateTime NOT NULL, 
+  [JobId] UniqueIdentifier NOT NULL, 
+  [UserId] UniqueIdentifier, 
+  [SlaveId] UniqueIdentifier, 
+  [Exception] VarChar(MAX), 
+  CONSTRAINT [PK_dbo.StateLog] PRIMARY KEY ([StateLogId])
+  )
+CREATE TABLE [dbo].[HiveExperimentPermission](
+  [HiveExperimentId] UniqueIdentifier NOT NULL, 
+  [GrantedUserId] UniqueIdentifier NOT NULL, 
+  [GrantedByUserId] UniqueIdentifier NOT NULL, 
+  [Permission] VarChar(15) NOT NULL, 
+  CONSTRAINT [PK_dbo.HiveExperimentPermission] PRIMARY KEY ([HiveExperimentId], [GrantedUserId])
+  )
+CREATE TABLE [Lifecycle](
+  [LifecycleId] Int, 
+  [LastCleanup] DateTime, 
+  CONSTRAINT [PK_Lifecycle] PRIMARY KEY ([LifecycleId])
+  )
+CREATE TABLE [DeletedJobStatistics](
+  [UserId] UniqueIdentifier NOT NULL, 
+  [ExecutionTimeMs] float NOT NULL, 
+  [ExecutionTimeMsFinishedJobs] float NOT NULL, 
+  [StartToEndTimeMs] float NOT NULL, 
+  [DeletedJobStatisticsId] UniqueIdentifier NOT NULL, 
+  CONSTRAINT [PK_DeletedJobStatistics] PRIMARY KEY ([DeletedJobStatisticsId])
+  )
+CREATE TABLE [UserStatistics](
+  [StatisticsId] UniqueIdentifier NOT NULL, 
+  [UserId] UniqueIdentifier NOT NULL, 
+  [ExecutionTimeMs] float NOT NULL, 
+  [UsedCores] Int NOT NULL, 
+  [ExecutionTimeMsFinishedJobs] float NOT NULL, 
+  [StartToEndTimeMs] float NOT NULL, 
+  CONSTRAINT [PK_UserStatistics] PRIMARY KEY ([StatisticsId], [UserId])
+  )
+CREATE TABLE [SlaveStatistics](
+  [StatisticsId] UniqueIdentifier NOT NULL, 
+  [SlaveId] UniqueIdentifier NOT NULL, 
+  [Cores] Int NOT NULL, 
+  [FreeCores] Int NOT NULL, 
+  [CpuUtilization] float NOT NULL, 
+  [Memory] Int NOT NULL, 
+  [FreeMemory] Int NOT NULL, 
+  CONSTRAINT [PK_SlaveStatistics] PRIMARY KEY ([StatisticsId], [SlaveId])
+  )
+CREATE TABLE [Statistics](
+  [StatisticsId] UniqueIdentifier NOT NULL, 
+  [Timestamp] DateTime NOT NULL, 
+  CONSTRAINT [PK_Statistics] PRIMARY KEY ([StatisticsId])
+  )
+ALTER TABLE [dbo].[AssignedResources]
+  ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
+ALTER TABLE [dbo].[AssignedResources]
+  ADD CONSTRAINT [Job_AssignedResource] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
+ALTER TABLE [dbo].[RequiredPlugins]
+  ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId])
+ALTER TABLE [dbo].[RequiredPlugins]
+  ADD CONSTRAINT [Job_RequiredPlugin] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
+ALTER TABLE [dbo].[Resource]
+  ADD CONSTRAINT [Resource_Resource] FOREIGN KEY ([ParentResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
+ALTER TABLE [dbo].[Job]
+  ADD CONSTRAINT [Job_Job] FOREIGN KEY ([ParentJobId]) REFERENCES [dbo].[Job]([JobId])
+ALTER TABLE [dbo].[Job]
+  ADD CONSTRAINT [HiveExperiment_Job] FOREIGN KEY ([HiveExperimentId]) REFERENCES [dbo].[HiveExperiment]([HiveExperimentId])
+ALTER TABLE [dbo].[UptimeCalendar]
+  ADD CONSTRAINT [Resource_UptimeCalendar] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId])
+ALTER TABLE [dbo].[JobData]
+  ADD CONSTRAINT [Job_JobData] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
+ALTER TABLE [dbo].[PluginData]
+  ADD CONSTRAINT [Plugin_PluginData] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId])
+ALTER TABLE [dbo].[StateLog]
+  ADD CONSTRAINT [Job_StateLog] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
+ALTER TABLE [dbo].[StateLog]
+  ADD CONSTRAINT [Resource_StateLog] FOREIGN KEY ([SlaveId]) REFERENCES [dbo].[Resource]([ResourceId])
+ALTER TABLE [dbo].[HiveExperimentPermission]
+  ADD CONSTRAINT [HiveExperiment_HiveExperimentPermission] FOREIGN KEY ([HiveExperimentId]) REFERENCES [dbo].[HiveExperiment]([HiveExperimentId])
+ALTER TABLE [UserStatistics]
+  ADD CONSTRAINT [Statistics_UserStatistics] FOREIGN KEY ([StatisticsId]) REFERENCES [Statistics]([StatisticsId])
+ALTER TABLE [SlaveStatistics]
+  ADD CONSTRAINT [Statistics_SlaveStatistics] FOREIGN KEY ([StatisticsId]) REFERENCES [Statistics]([StatisticsId])
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql	(revision 6701)
@@ -0,0 +1,244 @@
+USE [HeuristicLab.Hive-3.4]
+/* this script is supposed to be executed after the plain DB is generated by the linq-to-sql schema */
+/* adds default values */
+/* creates delete and update cascades */
+/* creates indices */
+/* creates views */
+/* creates triggers */
+
+
+ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Job_AssignedResource]
+ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Job_AssignedResource] FOREIGN KEY([JobId])
+REFERENCES [dbo].[Job] ([JobId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Resource_AssignedResource]
+ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId])
+REFERENCES [dbo].[Resource] ([ResourceId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
+ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (NEWSEQUENTIALID()) FOR JobId;
+GO
+
+ALTER TABLE [dbo].[StateLog]  DROP  CONSTRAINT [Job_StateLog]
+ALTER TABLE [dbo].[StateLog]  WITH CHECK ADD CONSTRAINT [Job_StateLog] FOREIGN KEY([JobId])
+REFERENCES [dbo].[Job] ([JobId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+ALTER TABLE [dbo].[StateLog]  DROP  CONSTRAINT [Resource_StateLog]
+ALTER TABLE [dbo].[StateLog]  WITH CHECK ADD CONSTRAINT [Resource_StateLog] FOREIGN KEY([SlaveId])
+REFERENCES [dbo].[Resource] ([ResourceId])
+ON UPDATE CASCADE
+ON DELETE SET NULL
+GO
+
+ALTER TABLE dbo.Plugin ALTER COLUMN PluginId ADD ROWGUIDCOL;
+ALTER TABLE dbo.Plugin WITH NOCHECK ADD CONSTRAINT [DF_Plugin_PluginId] DEFAULT (NEWSEQUENTIALID()) FOR PluginId;
+
+ALTER TABLE dbo.PluginData ALTER COLUMN PluginDataId ADD ROWGUIDCOL;
+ALTER TABLE dbo.PluginData WITH NOCHECK ADD CONSTRAINT [DF_PluginData_PluginDataId] DEFAULT (NEWSEQUENTIALID()) FOR PluginDataId;
+
+ALTER TABLE [dbo].[PluginData]  DROP  CONSTRAINT [Plugin_PluginData]
+ALTER TABLE [dbo].[PluginData]  WITH CHECK ADD  CONSTRAINT [Plugin_PluginData] FOREIGN KEY([PluginId])
+REFERENCES [dbo].[Plugin] ([PluginId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId ADD ROWGUIDCOL;
+ALTER TABLE dbo.RequiredPlugins WITH NOCHECK ADD CONSTRAINT [DF_RequiredPlugins_RequiredPluginId] DEFAULT (NEWSEQUENTIALID()) FOR RequiredPluginId;
+
+ALTER TABLE [dbo].[RequiredPlugins]  DROP  CONSTRAINT [Job_RequiredPlugin]
+ALTER TABLE [dbo].[RequiredPlugins]  WITH CHECK ADD  CONSTRAINT [Job_RequiredPlugin] FOREIGN KEY([JobId])
+REFERENCES [dbo].[Job] ([JobId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[RequiredPlugins]  DROP  CONSTRAINT [Plugin_RequiredPlugin]
+ALTER TABLE [dbo].[RequiredPlugins]  WITH CHECK ADD  CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY([PluginId])
+REFERENCES [dbo].[Plugin] ([PluginId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE dbo.Resource ALTER COLUMN ResourceId ADD ROWGUIDCOL;
+ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (NEWSEQUENTIALID()) FOR ResourceId;
+
+ALTER TABLE dbo.Downtime ALTER COLUMN DowntimeId ADD ROWGUIDCOL;
+ALTER TABLE dbo.Downtime WITH NOCHECK ADD CONSTRAINT [DF_Downtime_DowntimeId] DEFAULT (NEWSEQUENTIALID()) FOR DowntimeId;
+
+ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId ADD ROWGUIDCOL;
+ALTER TABLE dbo.HiveExperiment WITH NOCHECK ADD CONSTRAINT [DF_HiveExperiment_HiveExperimentId] DEFAULT (NEWSEQUENTIALID()) FOR HiveExperimentId;
+
+ALTER TABLE dbo.StateLog ALTER COLUMN StateLogId ADD ROWGUIDCOL;
+ALTER TABLE dbo.StateLog WITH NOCHECK ADD CONSTRAINT [DF_StateLog_StateLogId] DEFAULT (NEWSEQUENTIALID()) FOR StateLogId;
+
+ALTER TABLE [dbo].[HiveExperimentPermission]  DROP  CONSTRAINT [HiveExperiment_HiveExperimentPermission]
+ALTER TABLE [dbo].[HiveExperimentPermission]  WITH CHECK ADD CONSTRAINT [HiveExperiment_HiveExperimentPermission] FOREIGN KEY([HiveExperimentId])
+REFERENCES [dbo].[HiveExperiment] ([HiveExperimentId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[Statistics] ALTER COLUMN StatisticsId ADD ROWGUIDCOL;
+ALTER TABLE [dbo].[Statistics] WITH NOCHECK ADD CONSTRAINT [DF_Statistics_StatisticsId] DEFAULT (NEWSEQUENTIALID()) FOR StatisticsId;
+GO
+
+ALTER TABLE [dbo].[DeletedJobStatistics] ALTER COLUMN DeletedJobStatisticsId ADD ROWGUIDCOL;
+ALTER TABLE [dbo].[DeletedJobStatistics] WITH NOCHECK ADD CONSTRAINT [DF_DeletedJobStatistics_DeletedJobStatisticsId] DEFAULT (NEWSEQUENTIALID()) FOR DeletedJobStatisticsId;
+GO
+
+ALTER TABLE [dbo].[SlaveStatistics]  DROP  CONSTRAINT [Statistics_SlaveStatistics]
+ALTER TABLE [dbo].[SlaveStatistics]  WITH CHECK ADD  CONSTRAINT [Statistics_SlaveStatistics] FOREIGN KEY([StatisticsId])
+REFERENCES [dbo].[Statistics] ([StatisticsId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[UserStatistics]  DROP  CONSTRAINT [Statistics_UserStatistics]
+ALTER TABLE [dbo].[UserStatistics]  WITH CHECK ADD  CONSTRAINT [Statistics_UserStatistics] FOREIGN KEY([StatisticsId])
+REFERENCES [dbo].[Statistics] ([StatisticsId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+/* create indices */
+CREATE INDEX Index_RequiredPlugins_JobId ON RequiredPlugins(JobId);
+GO
+
+/* views */
+-- =============================================
+-- Author:		cneumuel
+-- Description:	Returns the first StateLog entry for each job
+-- =============================================
+CREATE VIEW [dbo].[view_FirstState]
+AS
+SELECT     sl.JobId, sl.DateTime, sl.State
+FROM         dbo.StateLog AS sl INNER JOIN
+                          (SELECT     JobId, MIN(DateTime) AS DateTime
+                            FROM          dbo.StateLog
+                            GROUP BY JobId) AS minDate ON sl.DateTime = minDate.DateTime AND sl.JobId = minDate.JobId
+
+GO
+
+-- =============================================
+-- Author:		cneumuel
+-- Description:	Returns the last StateLog entry for each job
+-- =============================================
+CREATE VIEW [dbo].[view_LastState]
+AS
+SELECT     sl.JobId, sl.DateTime, sl.State
+FROM         dbo.StateLog AS sl INNER JOIN
+                          (SELECT     JobId, MAX(DateTime) AS DateTime
+                            FROM          dbo.StateLog
+                            GROUP BY JobId) AS minDate ON sl.DateTime = minDate.DateTime AND sl.JobId = minDate.JobId
+GO
+
+-- =============================================
+-- Author:		cneumuel
+-- Description:	returns aggregates statistic information for every minute
+-- =============================================
+CREATE VIEW [dbo].[view_Statistics]
+AS
+SELECT  CONVERT(VARCHAR(19), MIN(s.Timestamp), 120) AS DateTime, SUM(ss.Cores) AS Cores, SUM(ss.FreeCores) AS FreeCores, 
+        AVG(ss.CpuUtilization) AS CpuUtilization, SUM(ss.Memory) AS Memory, SUM(ss.FreeMemory) AS FreeMemory, x.exSum AS ExecutionTimeHours, 
+        x.exFinishedSum AS ExecutionTimeFinished, x.exStartToEndSum AS StartToEndTimeFinished
+FROM         dbo.SlaveStatistics AS ss INNER JOIN
+                      dbo.[Statistics] AS s ON ss.StatisticsId = s.StatisticsId INNER JOIN
+                      dbo.Resource AS r ON ss.SlaveId = r.ResourceId INNER JOIN
+                          (SELECT     StatisticsId, SUM(ExecutionTimeMs) / 1000 / 60 / 60 AS exSum, SUM(ExecutionTimeMsFinishedJobs) / 1000 / 60 / 60 AS exFinishedSum, 
+                                                   SUM(StartToEndTimeMs) / 1000 / 60 / 60 AS exStartToEndSum
+                            FROM          dbo.UserStatistics AS us
+                            GROUP BY StatisticsId) AS x ON s.StatisticsId = x.StatisticsId
+GROUP BY s.StatisticsId, x.exSum, x.exFinishedSum, x.exStartToEndSum
+
+/* triggers */
+GO
+/****** Object:  Trigger [dbo].[tr_HiveExperimentDeleteCascade]    Script Date: 04/19/2011 16:31:53 ******/
+SET ANSI_NULLS ON
+GO
+SET QUOTED_IDENTIFIER ON
+GO
+-- =============================================
+-- Author:		cneumuel
+-- Create date: 19.04.2011
+-- Description:	(1) Writes the execution times of deleted jobs into DeletedJobStats to ensure correct statistics
+--				(2) Deletes all associated jobs. This cannot be done with cascading delete, 
+--              because the job table defines a INSTEAD OF DELETE trigger itself, which
+--              is not compatible with cascading deletes.
+-- =============================================
+CREATE TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] INSTEAD OF DELETE AS 
+BEGIN
+	DELETE Job FROM deleted, Job WHERE deleted.HiveExperimentId = Job.HiveExperimentId
+	DELETE HiveExperiment FROM deleted, HiveExperiment WHERE deleted.HiveExperimentId = HiveExperiment.HiveExperimentId
+END
+GO
+
+-- =============================================
+-- Author:		cneumuel
+-- Create date: 11.11.2010
+-- Description:	Recursively deletes all child-jobs of a job when it is deleted. (Source: http://devio.wordpress.com/2008/05/23/recursive-delete-in-sql-server/)
+-- =============================================
+CREATE TRIGGER [dbo].[tr_JobDeleteCascade] ON [dbo].[Job] INSTEAD OF DELETE AS 
+BEGIN
+	-- add statistics
+	INSERT INTO dbo.DeletedJobStatistics (UserId, ExecutionTimeMs, ExecutionTimeMsFinishedJobs, StartToEndTimeMs)
+	SELECT 
+		he.OwnerUserId AS UserId, 
+		SUM(j.ExecutionTimeMs) AS ExecutionTimeMs, 
+		ISNULL(SUM(CASE ls.State WHEN 'Finished' THEN j.ExecutionTimeMs END), 0) AS ExecutionTimeMsFinishedJobs,
+		ISNULL(SUM(CASE ls.State WHEN 'Finished' THEN DATEDIFF(MS,fs.DateTime,ls.DateTime) ELSE 0 END), 0) AS StartToEndMs
+	FROM 
+		deleted j, 
+		HiveExperiment he, 
+		view_FirstState fs, 
+		view_LastState ls
+	WHERE 
+		he.HiveExperimentId = j.HiveExperimentId AND 
+		fs.JobId = j.JobId AND 
+		ls.JobId = j.JobId
+	GROUP BY he.OwnerUserId
+
+	-- recursively delete jobs
+	CREATE TABLE #Table( 
+		JobId uniqueidentifier 
+	)
+	INSERT INTO #Table (JobId)
+	SELECT JobId FROM deleted
+	
+	DECLARE @c INT
+	SET @c = 0
+	
+	WHILE @c <> (SELECT COUNT(JobId) FROM #Table) BEGIN
+		SELECT @c = COUNT(JobId) FROM #Table
+		
+		INSERT INTO #Table (JobId)
+			SELECT Job.JobId
+			FROM Job
+			LEFT OUTER JOIN #Table ON Job.JobId = #Table.JobId
+			WHERE Job.ParentJobId IN (SELECT JobId FROM #Table)
+				AND #Table.JobId IS NULL
+	END
+	
+	DELETE JobData FROM JobData INNER JOIN #Table ON JobData.JobId = #Table.JobId
+	DELETE Job FROM Job INNER JOIN #Table ON Job.JobId = #Table.JobId
+END
+GO
+
+-- =============================================
+-- Author:		cneumuel
+-- Create date: 17.05.2011
+-- Description:	Writes the execution times of deleted jobs into DeletedJobStats to ensure correct statistics
+-- =============================================
+--CREATE TRIGGER [dbo].[tr_DeletedJobStats] ON [dbo].[Job] AFTER DELETE AS
+--BEGIN
+
+
+--END
+--GO
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Daily Statistics.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Daily Statistics.sql	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Daily Statistics.sql	(revision 6701)
@@ -0,0 +1,13 @@
+/****** Script for SelectTopNRows command from SSMS  ******/
+SELECT CONVERT(VARCHAR(10), [DateTime], 104) AS [Day]
+      ,AVG(CAST([Cores] AS FLOAT)) AS Cores
+      ,AVG(CAST([FreeCores] AS FLOAT)) AS FreeCores
+      ,AVG([CpuUtilization]) AS CpuUtilization
+      ,AVG(CAST([Memory] AS FLOAT)) AS Memory
+      ,AVG(CAST([FreeMemory] AS FLOAT)) AS FreeMemory
+      ,MAX([ExecutionTimeHours]) AS [ExecutionTimeHours]
+      ,MAX([ExecutionTimeFinished]) AS [ExecutionTimeFinished]
+      ,MAX([StartToEndTimeFinished]) AS [StartToEndTimeFinished]
+  FROM [HeuristicLab.Hive-3.4].[dbo].[view_Statistics]
+  GROUP BY CONVERT(VARCHAR(10), [DateTime], 104)
+  ORDER BY CONVERT(VARCHAR(10), [DateTime], 104) DESC
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Jobs.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Jobs.sql	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Jobs.sql	(revision 6701)
@@ -0,0 +1,30 @@
+/****** Script for SelectTopNRows command from SSMS  ******/
+SELECT j.[JobId]
+      ,j.[JobState]
+      ,j.[ExecutionTimeMs]/1000/60/60 AS ExecutionTimeHours
+      ,DATALENGTH(jd.data)/1024.0/1024.0 AS MB
+      ,he.Name AS Experiment
+      ,he.DateCreated   
+      ,u.UserName
+      ,j.[LastHeartbeat]
+      ,j.[Priority]
+      ,j.[CoresNeeded]
+      ,j.[MemoryNeeded]
+      ,j.[IsPrivileged]
+      ,j.[Command]
+      ,j.[IsParentJob]   
+      ,j.[FinishWhenChildJobsFinished]
+      ,j.[ParentJobId]
+      , he.HiveExperimentId
+  FROM 
+	[HeuristicLab.Hive-3.4].[dbo].[Job] j
+	,[HeuristicLab.Hive-3.4].[dbo].[HiveExperiment] he
+	,[HeuristicLab.Authentication].dbo.aspnet_Users u
+	,[HeuristicLab.Hive-3.4].dbo.JobData jd
+  WHERE
+	j.HiveExperimentId = he.HiveExperimentId
+	AND j.JobId = jd.JobId
+	AND he.OwnerUserId = u.UserId
+	--AND he.DateCreated > '06-03-2011 10:30'
+	
+ORDER BY j.JobState, he.DateCreated DESC
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Statistics.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Statistics.sql	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Query Statistics.sql	(revision 6701)
@@ -0,0 +1,12 @@
+SELECT [DateTime]
+      ,[Cores]
+      ,[FreeCores]
+      ,[CpuUtilization]
+      ,[Memory]
+      ,[FreeMemory]
+      ,[ExecutionTimeHours]
+      ,[ExecutionTimeFinished]
+      ,[StartToEndTimeFinished]
+  FROM [HeuristicLab.Hive-3.4].[dbo].[view_Statistics]
+  --WHERE [DateTime] > '2011-06-24 14:30'
+  ORDER BY [DateTime] DESC
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.Designer.cs	(revision 6701)
@@ -0,0 +1,46 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.225
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=T" +
+            "rue;")]
+        public string HeuristicLab_Hive_LinqConnectionString {
+            get {
+                return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("00:05:00")]
+        public global::System.TimeSpan LongRunningDatabaseCommandTimeout {
+            get {
+                return ((global::System.TimeSpan)(this["LongRunningDatabaseCommandTimeout"]));
+            }
+        }
+    }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Settings.settings	(revision 6701)
@@ -0,0 +1,17 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Services.Hive.DataAccess.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
+      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;ConnectionString&gt;Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;&lt;/ConnectionString&gt;
+  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+      <Value Profile="(Default)">Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;</Value>
+    </Setting>
+    <Setting Name="LongRunningDatabaseCommandTimeout" Type="System.TimeSpan" Scope="Application">
+      <Value Profile="(Default)">00:05:00</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/TransactionManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/TransactionManager.cs	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/TransactionManager.cs	(revision 6701)
@@ -0,0 +1,83 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Transactions;
+using HeuristicLab.Services.Hive.Common;
+
+namespace HeuristicLab.Services.Hive.DataAccess {  
+  public class TransactionManager : ITransactionManager {    
+    public void UseTransaction(Action call, bool serializable = false, bool longRunning = false) {
+      int n = 10;
+      while (n > 0) {
+        TransactionScope transaction = CreateTransaction(serializable, longRunning);
+        try {
+          call();
+          transaction.Complete();
+          n = 0;
+        }
+        catch (System.Data.SqlClient.SqlException e) {
+          n--; // probably deadlock situation, let it roll back and repeat the transaction n times
+          LogFactory.GetLogger(typeof(TransactionManager).Namespace).Log(string.Format("Exception occured, repeating transaction {0} more times. Details: {1}", n, e.ToString()));          
+          if (n <= 0) throw;
+        }
+        finally {
+          transaction.Dispose();
+        }
+      }
+    }
+
+    public T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false) {
+      int n = 10;
+      while (n > 0) {
+        TransactionScope transaction = CreateTransaction(serializable, longRunning);
+        try {
+          T result = call();
+          transaction.Complete();
+          n = 0;
+          return result;
+        }
+        catch (System.Data.SqlClient.SqlException e) {
+          n--; // probably deadlock situation, let it roll back and repeat the transaction n times
+          LogFactory.GetLogger(typeof(TransactionManager).Namespace).Log(string.Format("Exception occured, repeating transaction {0} more times. Details: {1}", n, e.ToString()));
+          if (n <= 0) throw;
+        }
+        finally {
+          transaction.Dispose();
+        }
+      }
+      throw new Exception("This code should not be reached");
+    }
+
+    private TransactionScope CreateTransaction(bool serializable, bool longRunning) {
+      var options = new TransactionOptions();
+      if (serializable)
+        options.IsolationLevel = IsolationLevel.Serializable;
+      else
+        options.IsolationLevel = IsolationLevel.ReadUncommitted;
+
+      if (longRunning)
+        options.Timeout = Settings.Default.LongRunningDatabaseCommandTimeout;
+
+      return new TransactionScope(TransactionScopeOption.Required, options);
+    }
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/app.config
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/app.config	(revision 6701)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.3/app.config	(revision 6701)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<configuration>
+  <configSections>
+    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+      <section name="HeuristicLab.Services.Hive.DataAccess.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+    </sectionGroup>
+  </configSections>
+  <connectionStrings>
+    <add name="HeuristicLab.Services.Hive.DataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString"
+      connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;"
+      providerName="System.Data.SqlClient" />
+  </connectionStrings>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><applicationSettings>
+    <HeuristicLab.Services.Hive.DataAccess.Settings>
+      <setting name="LongRunningDatabaseCommandTimeout" serializeAs="String">
+        <value>00:05:00</value>
+      </setting>
+    </HeuristicLab.Services.Hive.DataAccess.Settings>
+  </applicationSettings>
+</configuration>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs	(revision 6700)
+++ 	(revision )
@@ -1,363 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Data.Linq;
-using System.Linq;
-using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
-
-namespace HeuristicLab.Services.Hive.DataAccess {
-  public static class Convert {
-    #region Job
-    public static DT.Job ToDto(Job source) {
-      if (source == null) return null;
-      return new DT.Job {
-        Id = source.JobId,
-        CoresNeeded = source.CoresNeeded,
-        ExecutionTime = TimeSpan.FromMilliseconds(source.ExecutionTimeMs),
-        MemoryNeeded = source.MemoryNeeded,
-        ParentJobId = source.ParentJobId,
-        Priority = source.Priority,
-        PluginsNeededIds = (source.RequiredPlugins == null ? new List<Guid>() : source.RequiredPlugins.Select(x => x.PluginId).ToList()),
-        LastHeartbeat = source.LastHeartbeat,
-        State = source.State,
-        StateLog = (source.StateLogs == null ? new List<DT.StateLog>() : source.StateLogs.Select(x => Convert.ToDto(x)).OrderBy(x => x.DateTime).ToList()),
-        IsParentJob = source.IsParentJob,
-        FinishWhenChildJobsFinished = source.FinishWhenChildJobsFinished,
-        Command = source.Command,
-        LastJobDataUpdate = (source.JobData == null ? DateTime.MinValue : source.JobData.LastUpdate),
-        HiveExperimentId = source.HiveExperimentId,
-        IsPrivileged = source.IsPrivileged
-      };
-    }
-    public static Job ToEntity(DT.Job source) {
-      if (source == null) return null;
-      var entity = new Job(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Job source, Job target) {
-      if ((source != null) && (target != null)) {
-        target.JobId = source.Id;
-        target.CoresNeeded = source.CoresNeeded;
-        target.ExecutionTimeMs = source.ExecutionTime.TotalMilliseconds;
-        target.MemoryNeeded = source.MemoryNeeded;
-        target.ParentJobId = source.ParentJobId;
-        target.Priority = source.Priority;
-        target.LastHeartbeat = source.LastHeartbeat;
-        target.State = source.State;
-        if (target.StateLogs == null) target.StateLogs = new EntitySet<StateLog>();
-        foreach (DT.StateLog sl in source.StateLog.Where(x => x.Id == Guid.Empty)) {
-          target.StateLogs.Add(Convert.ToEntity(sl));
-        }
-        target.IsParentJob = source.IsParentJob;
-        target.FinishWhenChildJobsFinished = source.FinishWhenChildJobsFinished;
-        target.Command = source.Command;
-        // RequiredPlugins are added by Dao
-        target.HiveExperimentId = source.HiveExperimentId;
-        target.IsPrivileged = source.IsPrivileged;
-      }
-    }
-    #endregion
-
-    #region JobData
-    public static DT.JobData ToDto(JobData source) {
-      if (source == null) return null;
-      return new DT.JobData { JobId = source.JobId, Data = source.Data.ToArray(), LastUpdate = source.LastUpdate };
-    }
-    public static JobData ToEntity(DT.JobData source) {
-      if (source == null) return null;
-      var entity = new JobData(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.JobData source, JobData target) {
-      if ((source != null) && (target != null)) {
-        target.JobId = source.JobId; target.Data = new Binary(source.Data); target.LastUpdate = source.LastUpdate;
-      }
-    }
-    #endregion
-
-    #region StateLog
-    public static DT.StateLog ToDto(StateLog source) {
-      if (source == null) return null;
-      return new DT.StateLog { Id = source.StateLogId, DateTime = source.DateTime, Exception = source.Exception, JobId = source.JobId, SlaveId = source.SlaveId, State = source.State, UserId = source.UserId };
-    }
-    public static StateLog ToEntity(DT.StateLog source) {
-      if (source == null) return null;
-      var entity = new StateLog(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.StateLog source, StateLog target) {
-      if ((source != null) && (target != null)) {
-        target.StateLogId = source.Id; target.DateTime = source.DateTime; target.Exception = source.Exception; target.JobId = source.JobId; target.SlaveId = source.SlaveId; target.State = source.State; target.UserId = source.UserId;
-      }
-    }
-    #endregion
-
-    #region Downtimes
-    public static DT.Downtime ToDto(Downtime source) {
-      if (source == null) return null;
-      return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
-    }
-    public static Downtime ToEntity(DT.Downtime source) {
-      if (source == null) return null;
-      var entity = new Downtime(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Downtime source, Downtime target) {
-      if ((source != null) && (target != null)) {
-        target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate;
-      }
-    }
-    #endregion
-
-    #region HiveExperiment
-    public static DT.HiveExperiment ToDto(HiveExperiment source) {
-      if (source == null) return null;
-      return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, OwnerUserId = source.OwnerUserId, DateCreated = source.DateCreated, ResourceNames = source.ResourceIds, LastAccessed = source.LastAccessed };
-    }
-    public static HiveExperiment ToEntity(DT.HiveExperiment source) {
-      if (source == null) return null;
-      var entity = new HiveExperiment(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.HiveExperiment source, HiveExperiment target) {
-      if ((source != null) && (target != null)) {
-        target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.OwnerUserId = source.OwnerUserId; target.DateCreated = source.DateCreated; target.ResourceIds = source.ResourceNames; target.LastAccessed = source.LastAccessed;
-      }
-    }
-    #endregion
-
-    #region HiveExperimentPermission
-    public static DT.HiveExperimentPermission ToDto(HiveExperimentPermission source) {
-      if (source == null) return null;
-      return new DT.HiveExperimentPermission { HiveExperimentId = source.HiveExperimentId, GrantedUserId = source.GrantedUserId, GrantedByUserId = source.GrantedByUserId, Permission = source.Permission };
-    }
-    public static HiveExperimentPermission ToEntity(DT.HiveExperimentPermission source) {
-      if (source == null) return null;
-      var entity = new HiveExperimentPermission(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.HiveExperimentPermission source, HiveExperimentPermission target) {
-      if ((source != null) && (target != null)) {
-        target.HiveExperimentId = source.HiveExperimentId; target.GrantedUserId = source.GrantedUserId; target.GrantedByUserId = source.GrantedByUserId; target.Permission = source.Permission;
-      }
-    }
-    #endregion
-
-    #region Plugin
-    public static DT.Plugin ToDto(Plugin source) {
-      if (source == null) return null;
-      return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version), UserId = source.UserId, DateCreated = source.DateCreated, Hash = source.Hash };
-    }
-    public static Plugin ToEntity(DT.Plugin source) {
-      if (source == null) return null;
-      var entity = new Plugin(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Plugin source, Plugin target) {
-      if ((source != null) && (target != null)) {
-        target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString(); target.UserId = source.UserId; target.DateCreated = source.DateCreated; target.Hash = source.Hash;
-      }
-    }
-    #endregion
-
-    #region PluginData
-    public static DT.PluginData ToDto(PluginData source) {
-      if (source == null) return null;
-      return new DT.PluginData { Id = source.PluginDataId, PluginId = source.PluginId, Data = source.Data.ToArray(), FileName = source.FileName };
-    }
-    public static PluginData ToEntity(DT.PluginData source) {
-      if (source == null) return null;
-      var entity = new PluginData(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.PluginData source, PluginData target) {
-      if ((source != null) && (target != null)) {
-        target.PluginDataId = source.Id; target.PluginId = source.PluginId; target.Data = new Binary(source.Data); target.FileName = source.FileName;
-      }
-    }
-    #endregion
-
-    #region Slave
-    public static DT.Slave ToDto(Slave source) {
-      if (source == null) return null;
-      return new DT.Slave {
-        Id = source.ResourceId,
-        ParentResourceId = source.ParentResourceId,
-        Cores = source.Cores,
-        CpuSpeed = source.CpuSpeed,
-        FreeCores = source.FreeCores,
-        FreeMemory = source.FreeMemory,
-        IsAllowedToCalculate = source.IsAllowedToCalculate,
-        Memory = source.Memory,
-        Name = source.Name,
-        SlaveState = source.SlaveState,
-        CpuArchitecture = source.CpuArchitecture,
-        OperatingSystem = source.OperatingSystem,
-        LastHeartbeat = source.LastHeartbeat,
-        CpuUtilization = source.CpuUtilization
-      };
-    }
-    public static Slave ToEntity(DT.Slave source) {
-      if (source == null) return null;
-      var entity = new Slave(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Slave source, Slave target) {
-      if ((source != null) && (target != null)) {
-        target.ResourceId = source.Id;
-        target.ParentResourceId = source.ParentResourceId;
-        target.Cores = source.Cores;
-        target.CpuSpeed = source.CpuSpeed;
-        target.FreeCores = source.FreeCores;
-        target.FreeMemory = source.FreeMemory;
-        target.IsAllowedToCalculate = source.IsAllowedToCalculate;
-        target.Memory = source.Memory;
-        target.Name = source.Name;
-        target.SlaveState = source.SlaveState;
-        target.CpuArchitecture = source.CpuArchitecture;
-        target.OperatingSystem = source.OperatingSystem;
-        target.LastHeartbeat = source.LastHeartbeat;
-        target.CpuUtilization = source.CpuUtilization;
-      }
-    }
-    #endregion
-
-    #region SlaveGroup
-    public static DT.SlaveGroup ToDto(SlaveGroup source) {
-      if (source == null) return null;
-      return new DT.SlaveGroup { Id = source.ResourceId, Name = source.Name, ParentResourceId = source.ParentResourceId };
-    }
-    public static SlaveGroup ToEntity(DT.SlaveGroup source) {
-      if (source == null) return null;
-      var entity = new SlaveGroup(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.SlaveGroup source, SlaveGroup target) {
-      if ((source != null) && (target != null)) {
-        target.ResourceId = source.Id; target.Name = source.Name; target.ParentResourceId = source.ParentResourceId;
-      }
-    }
-    #endregion
-
-    #region Resource
-    public static DT.Resource ToDto(Resource source) {
-      if (source == null) return null;
-      return new DT.Resource { Id = source.ResourceId, Name = source.Name, ParentResourceId = source.ParentResourceId };
-    }
-    public static Resource ToEntity(DT.Resource source) {
-      if (source == null) return null;
-      var entity = new Resource(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Resource source, Resource target) {
-      if ((source != null) && (target != null)) {
-        target.ResourceId = source.Id; target.Name = source.Name; target.ParentResourceId = source.ParentResourceId;
-      }
-    }
-    #endregion
-
-    #region Statistics
-    public static DT.Statistics ToDto(Statistics source) {
-      if (source == null) return null;
-      return new DT.Statistics {
-        Id = source.StatisticsId,
-        TimeStamp = source.Timestamp,
-        SlaveStatistics = source.SlaveStatistics.Select(x => Convert.ToDto(x)).ToArray(),
-        UserStatistics = source.UserStatistics.Select(x => Convert.ToDto(x)).ToArray()
-      };
-    }
-    public static Statistics ToEntity(DT.Statistics source) {
-      if (source == null) return null;
-      var entity = new Statistics(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Statistics source, Statistics target) {
-      if ((source != null) && (target != null)) {
-        target.StatisticsId = source.Id;
-        target.Timestamp = source.TimeStamp;
-
-      }
-    }
-    #endregion
-
-    #region SlaveStatistics
-    public static DT.SlaveStatistics ToDto(SlaveStatistics source) {
-      if (source == null) return null;
-      return new DT.SlaveStatistics {
-        Id = source.StatisticsId,
-        SlaveId = source.SlaveId,
-        Cores = source.Cores,
-        CpuUtilization = source.CpuUtilization,
-        FreeCores = source.FreeCores,
-        FreeMemory = source.FreeMemory,
-        Memory = source.Memory
-      };
-    }
-    public static SlaveStatistics ToEntity(DT.SlaveStatistics source) {
-      if (source == null) return null;
-      var entity = new SlaveStatistics(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.SlaveStatistics source, SlaveStatistics target) {
-      if ((source != null) && (target != null)) {
-        target.StatisticsId = source.Id;
-        target.SlaveId = source.SlaveId;
-        target.Cores = source.Cores;
-        target.CpuUtilization = source.CpuUtilization;
-        target.FreeCores = source.FreeCores;
-        target.FreeMemory = source.FreeMemory;
-        target.Memory = source.Memory;
-      }
-    }
-    #endregion
-
-    #region UserStatistics
-    public static DT.UserStatistics ToDto(UserStatistics source) {
-      if (source == null) return null;
-      return new DT.UserStatistics {
-        Id = source.StatisticsId,
-        UserId = source.UserId,
-        UsedCores = source.UsedCores,
-        ExecutionTime = TimeSpan.FromMilliseconds(source.ExecutionTimeMs),
-        ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(source.ExecutionTimeMsFinishedJobs),
-        StartToEndTime = TimeSpan.FromMilliseconds(source.StartToEndTimeMs)
-      };
-    }
-    public static UserStatistics ToEntity(DT.UserStatistics source) {
-      if (source == null) return null;
-      var entity = new UserStatistics(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.UserStatistics source, UserStatistics target) {
-      if ((source != null) && (target != null)) {
-        target.StatisticsId = source.Id;
-        target.UserId = source.UserId;
-        target.UsedCores = source.UsedCores;
-        target.ExecutionTimeMs = source.ExecutionTime.TotalMilliseconds;
-        target.ExecutionTimeMsFinishedJobs = source.ExecutionTimeFinishedJobs.TotalMilliseconds;
-        target.StartToEndTimeMs = source.StartToEndTime.TotalMilliseconds;
-      }
-    }
-    #endregion
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 6700)
+++ 	(revision )
@@ -1,175 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{EC2C8109-6E1E-4C88-9A2B-908CFF2EF4AC}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>HeuristicLab.Services.Hive.DataAccess</RootNamespace>
-    <AssemblyName>HeuristicLab.Services.Hive.DataAccess-3.3</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <TargetFrameworkProfile />
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup>
-    <SignAssembly>true</SignAssembly>
-  </PropertyGroup>
-  <PropertyGroup>
-    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x86\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Services.Hive.DataAccess-3.4.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
-    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
-    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
-    <ErrorReport>prompt</ErrorReport>
-    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
-    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
-    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
-    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
-    <OutputPath>bin\x86\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <Optimize>true</Optimize>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <CodeAnalysisLogFile>bin\Release\HeuristicLab.Services.Hive.DataAccess-3.4.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
-    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
-    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
-    <ErrorReport>prompt</ErrorReport>
-    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
-    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
-    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
-    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="HeuristicLab.Common-3.3">
-      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Core-3.3">
-      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Persistence-3.3">
-      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
-      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Data.Linq" />
-    <Reference Include="System.Transactions" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Convert.cs" />
-    <None Include="HeuristicLabServicesHiveDataAccessPlugin.cs.frame" />
-    <Compile Include="HeuristicLabServicesHiveDataAccessPlugin.cs" />
-    <Compile Include="HiveDao.cs" />
-    <Compile Include="HiveDataContext.cs">
-      <DependentUpon>HiveDataContext.dbml</DependentUpon>
-    </Compile>
-    <Compile Include="HiveDataContext.designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>HiveDataContext.dbml</DependentUpon>
-    </Compile>
-    <Compile Include="Interfaces\IHiveDao.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <None Include="Properties\AssemblyInfo.cs.frame" />
-    <Compile Include="Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-      <DependentUpon>Settings.settings</DependentUpon>
-    </Compile>
-    <Compile Include="TransactionManager.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="app.config">
-      <SubType>Designer</SubType>
-    </None>
-    <None Include="HeuristicLab.snk" />
-    <None Include="HiveDataContext.dbml">
-      <Generator>MSLinqToSQLGenerator</Generator>
-      <LastGenOutput>HiveDataContext.designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </None>
-    <None Include="Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="HiveDataContext.dbml.layout">
-      <DependentUpon>HiveDataContext.dbml</DependentUpon>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\HeuristicLab.Services.Hive.Common\3.4\HeuristicLab.Services.Hive.Common-3.3.csproj">
-      <Project>{14424A16-48D4-445E-80BF-DDF617548BBB}</Project>
-      <Name>HeuristicLab.Services.Hive.Common-3.4</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="SQL Scripts\Query Daily Statistics.sql" />
-    <Content Include="SQL Scripts\Query Statistics.sql" />
-    <Content Include="SQL Scripts\Query Jobs.sql" />
-    <Content Include="SQL Scripts\Initialize Hive Database.sql" />
-    <Content Include="SQL Scripts\Prepare Hive Database.sql" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PostBuildEvent>set ProjectName=$(ProjectName)
-set TargetPath=$(TargetPath)
-call $(SolutionDir)/CopyAssembly.cmd</PostBuildEvent>
-  </PropertyGroup>
-  <PropertyGroup>
-    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
-set ProjectDir=$(ProjectDir)
-set SolutionDir=$(SolutionDir)
-set Outdir=$(Outdir)
-
-call PreBuildEvent.cmd</PreBuildEvent>
-  </PropertyGroup>
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLabServicesHiveDataAccessPlugin.cs.frame
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLabServicesHiveDataAccessPlugin.cs.frame	(revision 6700)
+++ 	(revision )
@@ -1,37 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.PluginInfrastructure;
-
-namespace HeuristicLab.Services.Hive.DataAccess {
-  [Plugin("HeuristicLab.Services.Hive.DataAccess", "3.3.5.$WCREV$")]
-  [PluginFile("HeuristicLab.Services.Hive.DataAccess-3.3.dll", PluginFileType.Assembly)]
-  [PluginDependency("HeuristicLab.Common", "3.3")]
-  [PluginDependency("HeuristicLab.Core", "3.3")]
-  [PluginDependency("HeuristicLab.Persistence", "3.3")]
-  [PluginDependency("HeuristicLab.Services.Hive.Common", "3.3")]
-  public class HeuristicLabServicesHiveDataAccessPlugin : PluginBase {
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs	(revision 6700)
+++ 	(revision )
@@ -1,830 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using HeuristicLab.Services.Hive.Common.DataTransfer;
-using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
-
-namespace HeuristicLab.Services.Hive.DataAccess {
-  public class HiveDao : IHiveDao {
-    public static HiveDataContext CreateContext(bool longRunning = false) {
-      var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
-      if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;
-      return context;
-    }
-
-    public HiveDao() { }
-
-    #region Job Methods
-    public DT.Job GetJob(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Jobs.SingleOrDefault(x => x.JobId == id));
-      }
-    }
-
-    public IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Jobs.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddJob(DT.Job dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.Jobs.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        foreach (Guid pluginId in dto.PluginsNeededIds) {
-          db.RequiredPlugins.InsertOnSubmit(new RequiredPlugin() { JobId = entity.JobId, PluginId = pluginId });
-        }
-        db.SubmitChanges();
-        return entity.JobId;
-      }
-    }
-
-    public void UpdateJob(DT.Job dto) {
-      using (var db = CreateContext()) {
-        var entity = db.Jobs.FirstOrDefault(x => x.JobId == dto.Id);
-        if (entity == null) db.Jobs.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        foreach (Guid pluginId in dto.PluginsNeededIds) {
-          if (db.RequiredPlugins.Count(p => p.PluginId == pluginId) == 0) {
-            db.RequiredPlugins.InsertOnSubmit(new RequiredPlugin() { JobId = entity.JobId, PluginId = pluginId });
-          }
-        }
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteJob(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Jobs.FirstOrDefault(x => x.JobId == id);
-        if (entity != null) db.Jobs.DeleteOnSubmit(entity);
-        db.SubmitChanges(); // JobData and child jobs are deleted by db-trigger
-      }
-    }
-
-    /// <summary>
-    /// returns all parent jobs which are waiting for their child jobs to finish
-    /// </summary>
-    /// <param name="resourceIds">list of resourceids which for which the jobs should be valid</param>
-    /// <param name="count">maximum number of jobs to return</param>
-    /// <param name="finished">if true, all parent jobs which have FinishWhenChildJobsFinished=true are returned, otherwise only FinishWhenChildJobsFinished=false are returned</param>
-    /// <returns></returns>
-    public IEnumerable<DT.Job> GetParentJobs(IEnumerable<Guid> resourceIds, int count, bool finished) {
-      using (var db = CreateContext()) {
-        var query = from ar in db.AssignedResources
-                    where resourceIds.Contains(ar.ResourceId)
-                       && ar.Job.State == JobState.Waiting
-                       && ar.Job.IsParentJob
-                       && (finished ? ar.Job.FinishWhenChildJobsFinished : !ar.Job.FinishWhenChildJobsFinished)
-                       && (from child in db.Jobs
-                           where child.ParentJobId == ar.Job.JobId
-                           select child.State == JobState.Finished
-                               || child.State == JobState.Aborted
-                               || child.State == JobState.Failed).All(x => x)
-                       && (from child in db.Jobs // avoid returning WaitForChildJobs jobs where no child-jobs exist (yet)
-                           where child.ParentJobId == ar.Job.JobId
-                           select child).Count() > 0
-                    orderby ar.Job.Priority descending, db.Random()
-                    select Convert.ToDto(ar.Job);
-        return count == 0 ? query.ToArray() : query.Take(count).ToArray();
-      }
-    }
-
-    public IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave, int count) {
-      using (var db = CreateContext()) {
-        var resourceIds = GetParentResources(slave.Id).Select(r => r.Id);
-        var waitingParentJobs = GetParentJobs(resourceIds, count, false);
-        if (count > 0 && waitingParentJobs.Count() >= count) return waitingParentJobs.Take(count).ToArray();
-
-        var query = from ar in db.AssignedResources
-                    where resourceIds.Contains(ar.ResourceId)
-                       && !(ar.Job.IsParentJob && ar.Job.FinishWhenChildJobsFinished)
-                       && ar.Job.State == JobState.Waiting
-                       && ar.Job.CoresNeeded <= slave.FreeCores
-                       && ar.Job.MemoryNeeded <= slave.FreeMemory
-                    orderby ar.Job.Priority descending, db.Random() // take random job to avoid the race condition that occurs when this method is called concurrently (the same job would be returned)
-                    select Convert.ToDto(ar.Job);
-        var waitingJobs = (count == 0 ? query : query.Take(count)).ToArray();
-        return waitingJobs.Union(waitingParentJobs).OrderByDescending(x => x.Priority);
-      }
-    }
-
-    public DT.Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception) {
-      using (var db = CreateContext()) {
-        var job = db.Jobs.SingleOrDefault(x => x.JobId == jobId);
-        job.State = jobState;
-        db.StateLogs.InsertOnSubmit(new StateLog {
-          JobId = jobId,
-          State = jobState,
-          SlaveId = slaveId,
-          UserId = userId,
-          Exception = exception,
-          DateTime = DateTime.Now
-        });
-        db.SubmitChanges();
-        job = db.Jobs.SingleOrDefault(x => x.JobId == jobId);
-        return Convert.ToDto(job);
-      }
-    }
-    #endregion
-
-    #region JobData Methods
-    public DT.JobData GetJobData(Guid id) {
-      using (var db = CreateContext(true)) {
-        return Convert.ToDto(db.JobDatas.SingleOrDefault(x => x.JobId == id));
-      }
-    }
-
-    public IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate) {
-      using (var db = CreateContext(true)) {
-        return db.JobDatas.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddJobData(DT.JobData dto) {
-      using (var db = CreateContext(true)) {
-        var entity = Convert.ToEntity(dto);
-        db.JobDatas.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.JobId;
-      }
-    }
-
-    public void UpdateJobData(DT.JobData dto) {
-      using (var db = CreateContext(true)) {
-        var entity = db.JobDatas.FirstOrDefault(x => x.JobId == dto.JobId);
-        if (entity == null) db.JobDatas.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteJobData(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.JobDatas.FirstOrDefault(x => x.JobId == id); // check if all the byte[] is loaded into memory here. otherwise work around to delete without loading it
-        if (entity != null) db.JobDatas.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region StateLog Methods
-    public DT.StateLog GetStateLog(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.StateLogs.SingleOrDefault(x => x.StateLogId == id));
-      }
-    }
-
-    public IEnumerable<DT.StateLog> GetStateLogs(Expression<Func<StateLog, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.StateLogs.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddStateLog(DT.StateLog dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.StateLogs.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.StateLogId;
-      }
-    }
-
-    public void UpdateStateLog(DT.StateLog dto) {
-      using (var db = CreateContext()) {
-        var entity = db.StateLogs.FirstOrDefault(x => x.StateLogId == dto.Id);
-        if (entity == null) db.StateLogs.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteStateLog(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.StateLogs.FirstOrDefault(x => x.StateLogId == id);
-        if (entity != null) db.StateLogs.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region HiveExperiment Methods
-    public DT.HiveExperiment GetHiveExperiment(Guid id) {
-      using (var db = CreateContext()) {
-        return AddStatsToExperiment(db, Convert.ToDto(db.HiveExperiments.SingleOrDefault(x => x.HiveExperimentId == id)));
-      }
-    }
-
-    private DT.HiveExperiment AddStatsToExperiment(HiveDataContext db, DT.HiveExperiment exp) {
-      if (exp == null)
-        return null;
-
-      var jobs = db.Jobs.Where(j => j.HiveExperimentId == exp.Id);
-      exp.JobCount = jobs.Count();
-      exp.CalculatingCount = jobs.Count(j => j.State == JobState.Calculating);
-      exp.FinishedCount = jobs.Count(j => j.State == JobState.Finished);
-      return exp;
-    }
-
-    public IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.HiveExperiments.Where(predicate).Select(x => AddStatsToExperiment(db, Convert.ToDto(x))).ToArray();
-      }
-    }
-
-    public Guid AddHiveExperiment(DT.HiveExperiment dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.HiveExperiments.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.HiveExperimentId;
-      }
-    }
-
-    public void UpdateHiveExperiment(DT.HiveExperiment dto) {
-      using (var db = CreateContext()) {
-        var entity = db.HiveExperiments.FirstOrDefault(x => x.HiveExperimentId == dto.Id);
-        if (entity == null) db.HiveExperiments.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteHiveExperiment(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.HiveExperiments.FirstOrDefault(x => x.HiveExperimentId == id);
-        if (entity != null) db.HiveExperiments.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region HiveExperimentPermission Methods
-    public DT.HiveExperimentPermission GetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.HiveExperimentPermissions.SingleOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId));
-      }
-    }
-
-    public IEnumerable<DT.HiveExperimentPermission> GetHiveExperimentPermissions(Expression<Func<HiveExperimentPermission, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.HiveExperimentPermissions.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public void AddHiveExperimentPermission(DT.HiveExperimentPermission dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.HiveExperimentPermissions.InsertOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto) {
-      using (var db = CreateContext()) {
-        var entity = db.HiveExperimentPermissions.FirstOrDefault(x => x.HiveExperimentId == dto.HiveExperimentId && x.GrantedUserId == dto.GrantedUserId);
-        if (entity == null) db.HiveExperimentPermissions.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId) {
-      using (var db = CreateContext()) {
-        var entity = db.HiveExperimentPermissions.FirstOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId);
-        if (entity != null) db.HiveExperimentPermissions.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-
-    /// <summary>
-    /// Sets the permissions for a experiment. makes sure that only one permission per user exists.
-    /// </summary>
-    public void SetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedByUserId, Guid grantedUserId, Permission permission) {
-      using (var db = CreateContext()) {
-        HiveExperimentPermission hiveExperimentPermission = db.HiveExperimentPermissions.SingleOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId);
-        if (hiveExperimentPermission != null) {
-          if (permission == Permission.NotAllowed) {
-            // not allowed, delete
-            db.HiveExperimentPermissions.DeleteOnSubmit(hiveExperimentPermission);
-          } else {
-            // update
-            hiveExperimentPermission.Permission = permission;
-            hiveExperimentPermission.GrantedByUserId = grantedByUserId; // update grantedByUserId, always the last "granter" is stored
-          }
-        } else {
-          // insert
-          if (permission != Permission.NotAllowed) {
-            hiveExperimentPermission = new HiveExperimentPermission() { HiveExperimentId = hiveExperimentId, GrantedByUserId = grantedByUserId, GrantedUserId = grantedUserId, Permission = permission };
-            db.HiveExperimentPermissions.InsertOnSubmit(hiveExperimentPermission);
-          }
-        }
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region Plugin Methods
-    public DT.Plugin GetPlugin(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Plugins.SingleOrDefault(x => x.PluginId == id));
-      }
-    }
-
-    public IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Plugins.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddPlugin(DT.Plugin dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.Plugins.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.PluginId;
-      }
-    }
-
-    public void UpdatePlugin(DT.Plugin dto) {
-      using (var db = CreateContext()) {
-        var entity = db.Plugins.FirstOrDefault(x => x.PluginId == dto.Id);
-        if (entity == null) db.Plugins.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeletePlugin(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Plugins.FirstOrDefault(x => x.PluginId == id);
-        if (entity != null) db.Plugins.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region PluginData Methods
-    public DT.PluginData GetPluginData(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.PluginDatas.SingleOrDefault(x => x.PluginDataId == id));
-      }
-    }
-
-    public IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.PluginDatas.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddPluginData(DT.PluginData dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.PluginDatas.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.PluginDataId;
-      }
-    }
-
-    public void UpdatePluginData(DT.PluginData dto) {
-      using (var db = CreateContext()) {
-        var entity = db.PluginDatas.FirstOrDefault(x => x.PluginId == dto.PluginId);
-        if (entity == null) db.PluginDatas.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeletePluginData(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.PluginDatas.FirstOrDefault(x => x.PluginDataId == id);
-        if (entity != null) db.PluginDatas.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region Slave Methods
-    public DT.Slave GetSlave(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Resources.OfType<Slave>().SingleOrDefault(x => x.ResourceId == id));
-      }
-    }
-
-    public IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Resources.OfType<Slave>().Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddSlave(DT.Slave dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.Resources.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.ResourceId;
-      }
-    }
-
-    public void UpdateSlave(DT.Slave dto) {
-      using (var db = CreateContext()) {
-        var entity = db.Resources.OfType<Slave>().FirstOrDefault(x => x.ResourceId == dto.Id);
-        if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteSlave(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Resources.OfType<Slave>().FirstOrDefault(x => x.ResourceId == id);
-        if (entity != null) db.Resources.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region SlaveGroup Methods
-    public DT.SlaveGroup GetSlaveGroup(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Resources.OfType<SlaveGroup>().SingleOrDefault(x => x.ResourceId == id));
-      }
-    }
-
-    public IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Resources.OfType<SlaveGroup>().Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddSlaveGroup(DT.SlaveGroup dto) {
-      using (var db = CreateContext()) {
-        if (dto.Id == Guid.Empty)
-          dto.Id = Guid.NewGuid();
-        var entity = Convert.ToEntity(dto);
-        db.Resources.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.ResourceId;
-      }
-    }
-
-    public void UpdateSlaveGroup(DT.SlaveGroup dto) {
-      using (var db = CreateContext()) {
-        var entity = db.Resources.OfType<SlaveGroup>().FirstOrDefault(x => x.ResourceId == dto.Id);
-        if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteSlaveGroup(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Resources.OfType<SlaveGroup>().FirstOrDefault(x => x.ResourceId == id);
-        if (entity != null) {
-          if (db.Resources.Where(r => r.ParentResourceId == id).Count() > 0) {
-            throw new InvalidOperationException("Cannot delete SlaveGroup as long as there are Slaves in the group");
-          }
-          db.Resources.DeleteOnSubmit(entity);
-        }
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region Resource Methods
-    public DT.Resource GetResource(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Resources.SingleOrDefault(x => x.ResourceId == id));
-      }
-    }
-
-    public IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Resources.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddResource(DT.Resource dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.Resources.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.ResourceId;
-      }
-    }
-
-    public void UpdateResource(DT.Resource dto) {
-      using (var db = CreateContext()) {
-        var entity = db.Resources.FirstOrDefault(x => x.ResourceId == dto.Id);
-        if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteResource(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Resources.FirstOrDefault(x => x.ResourceId == id);
-        if (entity != null) db.Resources.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void AssignJobToResource(Guid jobId, Guid resourceId) {
-      using (var db = CreateContext()) {
-        var job = db.Jobs.Where(x => x.JobId == jobId).Single();
-        job.AssignedResources.Add(new AssignedResource() { JobId = jobId, ResourceId = resourceId });
-        db.SubmitChanges();
-      }
-    }
-
-    public IEnumerable<DT.Resource> GetAssignedResources(Guid jobId) {
-      using (var db = CreateContext()) {
-        var job = db.Jobs.Where(x => x.JobId == jobId).Single();
-        return job.AssignedResources.Select(x => Convert.ToDto(x.Resource)).ToArray();
-      }
-    }
-
-    /// <summary>
-    /// Returns all parent resources of a resource (the given resource is also added)
-    /// </summary>
-    public IEnumerable<DT.Resource> GetParentResources(Guid resourceId) {
-      using (var db = CreateContext()) {
-        var resources = new List<Resource>();
-        CollectParentResources(resources, db.Resources.Where(r => r.ResourceId == resourceId).Single());
-        return resources.Select(r => Convert.ToDto(r)).ToArray();
-      }
-    }
-
-    private void CollectParentResources(List<Resource> resources, Resource resource) {
-      if (resource == null) return;
-      resources.Add(resource);
-      CollectParentResources(resources, resource.ParentResource);
-    }
-
-    /// <summary>
-    /// Returns all child resources of a resource (without the given resource)
-    /// </summary>
-    public IEnumerable<DT.Resource> GetChildResources(Guid resourceId) {
-      using (var db = CreateContext()) {
-        var childs = new List<DT.Resource>();
-        foreach (var child in db.Resources.Where(x => x.ParentResourceId == resourceId)) {
-          childs.Add(Convert.ToDto(child));
-          childs.AddRange(GetChildResources(child.ResourceId));
-        }
-        return childs;
-      }
-    }
-
-    public IEnumerable<DT.Job> GetJobsByResourceId(Guid resourceId) {
-      using (var db = CreateContext()) {
-        var resources = GetChildResources(resourceId).Select(x => x.Id).ToList();
-        resources.Add(resourceId);
-
-        var jobs = db.Jobs.Where(j =>
-          j.State == JobState.Calculating &&
-          j.StateLogs.OrderByDescending(x => x.DateTime).First().SlaveId.HasValue &&
-          resources.Contains(j.StateLogs.OrderByDescending(x => x.DateTime).First().SlaveId.Value));
-        return jobs.Select(j => Convert.ToDto(j)).ToArray();
-      }
-    }
-    #endregion
-
-    #region Authorization Methods
-    public Permission GetPermissionForJob(Guid jobId, Guid userId) {
-      using (var db = CreateContext()) {
-        return GetPermissionForExperiment(GetExperimentForJob(jobId), userId);
-      }
-    }
-
-    public Permission GetPermissionForExperiment(Guid experimentId, Guid userId) {
-      using (var db = CreateContext()) {
-        HiveExperiment hiveExperiment = db.HiveExperiments.SingleOrDefault(x => x.HiveExperimentId == experimentId);
-        if (hiveExperiment == null) return Permission.NotAllowed;
-        if (hiveExperiment.OwnerUserId == userId) return Permission.Full;
-        HiveExperimentPermission permission = db.HiveExperimentPermissions.SingleOrDefault(p => p.HiveExperimentId == experimentId && p.GrantedUserId == userId);
-        return permission != null ? permission.Permission : Permission.NotAllowed;
-      }
-    }
-
-    public Guid GetExperimentForJob(Guid jobId) {
-      using (var db = CreateContext()) {
-        return db.Jobs.Single(j => j.JobId == jobId).HiveExperimentId;
-      }
-    }
-    #endregion
-
-    #region Lifecycle Methods
-    public DateTime GetLastCleanup() {
-      using (var db = CreateContext()) {
-        var entity = db.Lifecycles.SingleOrDefault();
-        return entity != null ? entity.LastCleanup : DateTime.MinValue;
-      }
-    }
-
-    public void SetLastCleanup(DateTime datetime) {
-      using (var db = CreateContext()) {
-        var entity = db.Lifecycles.SingleOrDefault();
-        if (entity != null) {
-          entity.LastCleanup = datetime;
-        } else {
-          entity = new Lifecycle();
-          entity.LifecycleId = 0; // always only one entry with ID:0
-          entity.LastCleanup = datetime;
-          db.Lifecycles.InsertOnSubmit(entity);
-        }
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region Downtime Methods
-    public DT.Downtime GetDowntime(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Downtimes.SingleOrDefault(x => x.DowntimeId == id));
-      }
-    }
-
-    public IEnumerable<DT.Downtime> GetDowntimes(Expression<Func<Downtime, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Downtimes.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddDowntime(DT.Downtime dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.Downtimes.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.DowntimeId;
-      }
-    }
-
-    public void UpdateDowntime(DT.Downtime dto) {
-      using (var db = CreateContext()) {
-        var entity = db.Downtimes.FirstOrDefault(x => x.DowntimeId == dto.Id);
-        if (entity == null) db.Downtimes.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteDowntime(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Downtimes.FirstOrDefault(x => x.DowntimeId == id);
-        if (entity != null) db.Downtimes.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-    #endregion
-
-    #region Statistics Methods
-    public DT.Statistics GetStatistic(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.Statistics.SingleOrDefault(x => x.StatisticsId == id));
-      }
-    }
-
-    public IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.Statistics.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddStatistics(DT.Statistics dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.Statistics.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        foreach (var slaveStat in dto.SlaveStatistics) {
-          slaveStat.Id = entity.StatisticsId;
-          db.SlaveStatistics.InsertOnSubmit(Convert.ToEntity(slaveStat));
-        }
-        foreach (var userStat in dto.UserStatistics) {
-          userStat.Id = entity.StatisticsId;
-          db.UserStatistics.InsertOnSubmit(Convert.ToEntity(userStat));
-        }
-        db.SubmitChanges();
-        return entity.StatisticsId;
-      }
-    }
-
-    public void DeleteStatistics(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.Statistics.FirstOrDefault(x => x.StatisticsId == id);
-        if (entity != null) db.Statistics.DeleteOnSubmit(entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public List<DT.UserStatistics> GetUserStatistics() {
-      using (var db = CreateContext()) {
-        var userStats = new Dictionary<Guid, DT.UserStatistics>();
-
-        var usedCoresByUser = from job in db.Jobs
-                              where job.State == JobState.Calculating
-                              group job by job.HiveExperiment.OwnerUserId into g
-                              select new { UserId = g.Key, UsedCores = g.Count() };
-
-        foreach (var item in usedCoresByUser) {
-          if (!userStats.ContainsKey(item.UserId)) {
-            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
-          }
-          userStats[item.UserId].UsedCores += item.UsedCores;
-        }
-
-        var executionTimesByUser = from job in db.Jobs
-                                   group job by job.HiveExperiment.OwnerUserId into g
-                                   select new { UserId = g.Key, ExecutionTime = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()) };
-        foreach (var item in executionTimesByUser) {
-          if (!userStats.ContainsKey(item.UserId)) {
-            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
-          }
-          userStats[item.UserId].ExecutionTime += item.ExecutionTime;
-        }
-
-        // execution times only of finished jobs - necessary to compute efficieny
-        var executionTimesFinishedJobs = from job in db.Jobs
-                                         where job.State == JobState.Finished
-                                         group job by job.HiveExperiment.OwnerUserId into g
-                                         select new { UserId = g.Key, ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()) };
-
-        foreach (var item in executionTimesFinishedJobs) {
-          if (!userStats.ContainsKey(item.UserId)) {
-            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
-          }
-          userStats[item.UserId].ExecutionTimeFinishedJobs += item.ExecutionTimeFinishedJobs;
-        }
-
-        // start to end times only of finished jobs - necessary to compute efficiency
-        var startToEndTimesFinishedJobs = from job in db.Jobs
-                                          where job.State == JobState.Finished
-                                          group job by job.HiveExperiment.OwnerUserId into g
-                                          select new {
-                                            UserId = g.Key,
-                                            StartToEndTime = new TimeSpan(g.Select(x => x.StateLogs.OrderByDescending(sl => sl.DateTime).First().DateTime - x.StateLogs.OrderBy(sl => sl.DateTime).First().DateTime).Sum(ts => ts.Ticks))
-                                          };
-        foreach (var item in startToEndTimesFinishedJobs) {
-          if (!userStats.ContainsKey(item.UserId)) {
-            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
-          }
-          userStats[item.UserId].StartToEndTime += item.StartToEndTime;
-        }
-
-        // also consider executiontimes of DeletedJobStats 
-        var deletedJobsExecutionTimesByUsers = from del in db.DeletedJobStatistics
-                                               group del by del.UserId into g
-                                               select new {
-                                                 UserId = g.Key,
-                                                 ExecutionTime = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()),
-                                                 ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMsFinishedJobs).Sum()),
-                                                 StartToEndTime = TimeSpan.FromMilliseconds(g.Select(x => x.StartToEndTimeMs).Sum())
-                                               };
-        foreach (var item in deletedJobsExecutionTimesByUsers) {
-          if (!userStats.ContainsKey(item.UserId)) {
-            userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
-          }
-          userStats[item.UserId].ExecutionTime += item.ExecutionTime;
-          userStats[item.UserId].ExecutionTimeFinishedJobs += item.ExecutionTimeFinishedJobs;
-          userStats[item.UserId].StartToEndTime += item.StartToEndTime;
-        }
-
-        return userStats.Values.ToList();
-      }
-    }
-    #endregion
-
-    #region Helpers
-    private void CollectChildJobs(HiveDataContext db, Guid parentJobId, List<Job> collection) {
-      var jobs = db.Jobs.Where(j => j.ParentJobId == parentJobId);
-      foreach (var job in jobs) {
-        collection.Add(job);
-        if (job.IsParentJob)
-          CollectChildJobs(db, job.JobId, collection);
-      }
-    }
-    #endregion
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.cs	(revision 6700)
+++ 	(revision )
@@ -1,15 +1,0 @@
-using System;
-using System.Data.Linq.Mapping;
-namespace HeuristicLab.Services.Hive.DataAccess {
-  partial class SlaveStatistics {
-  }
-
-  partial class HiveDataContext {
-    // source: http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql
-    [Function(Name = "NEWID", IsComposable = true)]
-    public Guid Random() { 
-      // to prove not used by our C# code... 
-      throw new NotImplementedException();
-    }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml	(revision 6700)
+++ 	(revision )
@@ -1,195 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
-  <Connection Mode="AppSettings" ConnectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True" SettingsObjectName="HeuristicLab.Services.Hive.DataAccess.Settings" SettingsPropertyName="HeuristicLab_Hive_LinqConnectionString" Provider="System.Data.SqlClient" />
-  <Table Name="dbo.AssignedResources" Member="AssignedResources">
-    <Type Name="AssignedResource">
-      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
-      <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" DeleteRule="CASCADE" />
-    </Type>
-  </Table>
-  <Table Name="dbo.Plugin" Member="Plugins">
-    <Type Name="Plugin">
-      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
-      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-      <Column Name="Hash" Type="System.Byte[]" DbType="VarBinary(20) NOT NULL" CanBeNull="false" />
-      <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
-      <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" />
-    </Type>
-  </Table>
-  <Table Name="dbo.RequiredPlugins" Member="RequiredPlugins">
-    <Type Name="RequiredPlugin">
-      <Column Name="RequiredPluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" UpdateCheck="Never" />
-      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Association Name="Plugin_RequiredPlugin" Member="Plugin" Storage="_PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" DeleteRule="CASCADE" />
-      <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="dbo.Resource" Member="Resources">
-    <Type Name="Resource" InheritanceCode="RESOURCE">
-      <Column Name="ResourceId" AutoSync="OnInsert" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Column Name="ResourceType" Type="System.String" CanBeNull="false" IsDiscriminator="true" />
-      <Column Name="ParentResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource" />
-      <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
-      <Association Name="Resource_Downtime" Member="Downtimes" Storage="_UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="Downtime" />
-      <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
-      <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
-      <Type Name="Slave" InheritanceCode="Slave" IsInheritanceDefault="true">
-        <Column Name="CpuSpeed" Storage="_CPUSpeed" Type="System.Int32" DbType="Int" CanBeNull="true" />
-        <Column Name="Memory" Type="System.Int32" DbType="Int" CanBeNull="true" />
-        <Column Name="Login" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-        <Column Name="SlaveState" Storage="_Status" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState" DbType="VarChar(15)" CanBeNull="true" />
-        <Column Name="Cores" Storage="_NumberOfCores" Type="System.Int32" DbType="Int" CanBeNull="true" />
-        <Column Name="FreeCores" Storage="_NumberOfFreeCores" Type="System.Int32" DbType="Int" CanBeNull="true" />
-        <Column Name="FreeMemory" Type="System.Int32" DbType="Int" CanBeNull="true" />
-        <Column Name="IsAllowedToCalculate" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-        <Column Name="CpuArchitecture" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture" DbType="VarChar(3)" CanBeNull="false" />
-        <Column Name="OperatingSystem" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" UpdateCheck="Never" />
-        <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-        <Column Name="CpuUtilization" Type="System.Double" DbType="float" CanBeNull="false" />
-      </Type>
-      <Type Name="SlaveGroup" InheritanceCode="GROUP" />
-    </Type>
-  </Table>
-  <Table Name="dbo.Job" Member="Jobs">
-    <Type Name="Job">
-      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="JobState" Member="State" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(30)" CanBeNull="false" />
-      <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float" CanBeNull="false" />
-      <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Column Name="ParentJobId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="Priority" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="IsParentJob" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-      <Column Name="FinishWhenChildJobsFinished" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-      <Column Name="Command" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.Command?" DbType="VarChar(30)" CanBeNull="true" />
-      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="IsPrivileged" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-      <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
-      <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
-      <Association Name="Job_Job" Member="ChildJobs" Storage="_Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
-      <Association Name="Job_JobData" Member="JobData" ThisKey="JobId" OtherKey="JobId" Type="JobData" Cardinality="One" />
-      <Association Name="Job_StateLog" Member="StateLogs" ThisKey="JobId" OtherKey="JobId" Type="StateLog" />
-      <Association Name="Job_Job" Member="ParentJob" Storage="_Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
-      <Association Name="HiveExperiment_Job" Member="HiveExperiment" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperiment" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="dbo.Downtime" Member="Downtimes">
-    <Type Name="Downtime">
-      <Column Name="DowntimeId" Storage="_UptimeCalendarId" Type="System.Guid" DbType="UniqueIdentifier" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
-      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-      <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-      <Column Name="AllDayEvent" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-      <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-      <Column Name="RecurringId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
-      <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
-    </Type>
-  </Table>
-  <Table Name="dbo.HiveExperiment" Member="HiveExperiments">
-    <Type Name="HiveExperiment">
-      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
-      <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
-      <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
-      <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-      <Column Name="LastAccessed" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Column Name="IsHiveEngine" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
-      <Association Name="HiveExperiment_Job" Member="Jobs" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="Job" />
-      <Association Name="HiveExperiment_HiveExperimentPermission" Member="HiveExperimentPermissions" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperimentPermission" />
-    </Type>
-  </Table>
-  <Table Name="dbo.JobData" Member="JobDatas">
-    <Type Name="JobData">
-      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="false" UpdateCheck="Never" />
-      <Column Name="LastUpdate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-      <Association Name="Job_JobData" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="dbo.PluginData" Member="PluginDatas">
-    <Type Name="PluginData">
-      <Column Name="PluginDataId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX) NOT NULL" CanBeNull="false" UpdateCheck="Never" />
-      <Column Name="FileName" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Association Name="Plugin_PluginData" Member="Plugin" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="dbo.StateLog" Member="StateLogs">
-    <Type Name="StateLog">
-      <Column Name="StateLogId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="State" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState" DbType="VarChar(30) NOT NULL" CanBeNull="false" />
-      <Column Name="DateTime" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
-      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="SlaveId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Column Name="Exception" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Association Name="Job_StateLog" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
-      <Association Name="Resource_StateLog" Member="Resource" ThisKey="SlaveId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="dbo.HiveExperimentPermission" Member="HiveExperimentPermissions">
-    <Type Name="HiveExperimentPermission">
-      <Column Name="HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="Permission" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission" DbType="VarChar(15) NOT NULL" CanBeNull="false" />
-      <Association Name="HiveExperiment_HiveExperimentPermission" Member="HiveExperiment" ThisKey="HiveExperimentId" OtherKey="HiveExperimentId" Type="HiveExperiment" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="" Member="Lifecycles">
-    <Type Name="Lifecycle">
-      <Column Name="LifecycleId" Type="System.Int32" DbType="Int" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="LastCleanup" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-    </Type>
-  </Table>
-  <Table Name="" Member="DeletedJobStatistics">
-    <Type Name="DeletedJobStatistics">
-      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Column Name="ExecutionTimeMsFinishedJobs" Storage="_ExecutionTimeFinishedJobs" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Column Name="StartToEndTimeMs" Storage="_StartToEndTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Column Name="DeletedJobStatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-    </Type>
-  </Table>
-  <Table Name="" Member="UserStatistics">
-    <Type Name="UserStatistics">
-      <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Column Name="UsedCores" Storage="_CoresUsed" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="ExecutionTimeMsFinishedJobs" Storage="_ExecutionTimeFinishedJobs" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Column Name="StartToEndTimeMs" Storage="_StartToEndTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Association Name="Statistics_UserStatistics" Member="Statistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="Statistics" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="" Member="SlaveStatistics">
-    <Type Name="SlaveStatistics">
-      <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="SlaveId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="Cores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="FreeCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="CpuUtilization" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
-      <Column Name="Memory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Column Name="FreeMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
-      <Association Name="Statistics_SlaveStatistics" Member="Statistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="Statistics" IsForeignKey="true" />
-    </Type>
-  </Table>
-  <Table Name="" Member="Statistics">
-    <Type Name="Statistics">
-      <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
-      <Column Name="Timestamp" Type="System.DateTime" CanBeNull="false" />
-      <Association Name="Statistics_UserStatistics" Member="UserStatistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="UserStatistics" />
-      <Association Name="Statistics_SlaveStatistics" Member="SlaveStatistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="SlaveStatistics" />
-    </Type>
-  </Table>
-</Database>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout	(revision 6700)
+++ 	(revision )
@@ -1,231 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 24.25, 8.5" name="HiveDataContext">
-  <DataContextMoniker Name="/HiveDataContext" />
-  <nestedChildShapes>
-    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 4, 2, 1.1939925130208327">
-      <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
-      <nestedChildShapes>
-        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.4600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="8.875, 5.5, 2, 1.9631982421874996">
-      <DataClassMoniker Name="/HiveDataContext/Plugin" />
-      <nestedChildShapes>
-        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="8.89, 5.9600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="6.5, 5.5, 2, 1.3862939453124987">
-      <DataClassMoniker Name="/HiveDataContext/RequiredPlugin" />
-      <nestedChildShapes>
-        <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="6.5150000000000006, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.25, 1, 2, 1.5785953776041666">
-      <DataClassMoniker Name="/HiveDataContext/Resource" />
-      <nestedChildShapes>
-        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.265, 1.46, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.3093082682291666">
-      <DataClassMoniker Name="/HiveDataContext/Job" />
-      <nestedChildShapes>
-        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2.7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="13.5, 2.5, 2, 2.1554996744791666">
-      <DataClassMoniker Name="/HiveDataContext/Downtime" />
-      <nestedChildShapes>
-        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="13.515, 2.9600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.3478011067708326">
-      <DataClassMoniker Name="/HiveDataContext/HiveExperiment" />
-      <nestedChildShapes>
-        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="8.875, 0.75, 2, 3.1170068359375">
-      <DataClassMoniker Name="/HiveDataContext/Slave" />
-      <nestedChildShapes>
-        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="8.89, 1.21, 1.9700000000000002, 2.5570068359375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="13.5, 1, 2, 0.8093896484375">
-      <DataClassMoniker Name="/HiveDataContext/SlaveGroup" />
-      <nestedChildShapes>
-        <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="13.5, 1, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <inheritanceConnector edgePoints="[(11.25 : 1.78929768880208); (10.875 : 1.78929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="26f4edfa-91dd-4941-a058-359f89e567a8" />
-      </nodes>
-    </inheritanceConnector>
-    <inheritanceConnector edgePoints="[(13.25 : 1.40469482421875); (13.5 : 1.40469482421875)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="bbd91675-92f2-4a69-8429-0950008fc8a4" />
-      </nodes>
-    </inheritanceConnector>
-    <associationConnector edgePoints="[(11.9843735 : 2.57859537760417); (11.9843735 : 4.59699625651042); (10.875 : 4.59699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(7.5 : 4.30930826822917); (7.5 : 4.751650890625); (8.875 : 4.751650890625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(7.0893551015625 : 4.30930826822917); (7.0893551015625 : 5.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
-      <nodes>
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-        <classShapeMoniker Id="97b00810-fa30-457e-b484-b4e80b22f91b" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(7.20923076923077 : 1); (7.20923076923077 : 0.75); (7.80461538461539 : 0.75); (7.80461538461539 : 1)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
-      <nodes>
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-      </nodes>
-    </associationConnector>
-    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
-      <DataClassMoniker Name="/HiveDataContext/JobData" />
-      <nestedChildShapes>
-        <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="4.14, 1.46, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.25, 5.5, 2, 1.5785953776041666">
-      <DataClassMoniker Name="/HiveDataContext/PluginData" />
-      <nestedChildShapes>
-        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.265, 5.9600000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(10.875 : 6.28929768880208); (11.25 : 6.28929768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
-      <nodes>
-        <classShapeMoniker Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" />
-        <classShapeMoniker Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
-      <nodes>
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-        <classShapeMoniker Id="6bc13f26-f9a8-4597-b054-35be34190d12" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(8.875 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
-      <nodes>
-        <classShapeMoniker Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" />
-        <classShapeMoniker Id="97b00810-fa30-457e-b484-b4e80b22f91b" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(11.9524234637921 : 1); (11.9524234637921 : 0.75); (12.5617468474559 : 0.75); (12.5617468474559 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Resource" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-      </nodes>
-    </associationConnector>
-    <classShape Id="00352397-340e-449a-8e23-6ddd216e8617" absoluteBounds="1.75, 1, 2, 2.1554996744791666">
-      <DataClassMoniker Name="/HiveDataContext/StateLog" />
-      <nestedChildShapes>
-        <elementListCompartment Id="9a003897-deef-4bb5-b180-4c4bcdb7fadc" absoluteBounds="1.765, 1.46, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="4d800dc9-1b18-469f-b02c-d4554757c5e1" absoluteBounds="1.75, 3.625, 2, 1.5785953776041666">
-      <DataClassMoniker Name="/HiveDataContext/HiveExperimentPermission" />
-      <nestedChildShapes>
-        <elementListCompartment Id="dedd97d3-a9a2-45a2-9b95-d7366fb65a7f" absoluteBounds="1.765, 4.085, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Job/Job_StateLog" />
-      <nodes>
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-        <classShapeMoniker Id="00352397-340e-449a-8e23-6ddd216e8617" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(11.25 : 1.78929768880208); (10.9375 : 1.78929768880208); (10.9375 : 0.6875); (2.75 : 0.6875); (2.75 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_StateLog" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="00352397-340e-449a-8e23-6ddd216e8617" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(4.125 : 4.29890055338542); (3.75 : 4.29890055338542)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/HiveExperiment/HiveExperiment_HiveExperimentPermission" />
-      <nodes>
-        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
-        <classShapeMoniker Id="4d800dc9-1b18-469f-b02c-d4554757c5e1" />
-      </nodes>
-    </associationConnector>
-    <classShape Id="b4e7aaa8-a382-4560-a1fd-498de77e9340" absoluteBounds="1.75, 5.5, 2, 1.1939925130208327">
-      <DataClassMoniker Name="/HiveDataContext/Lifecycle" />
-      <nestedChildShapes>
-        <elementListCompartment Id="03597a2c-5c5d-4c2c-b741-c49ab5aa34d5" absoluteBounds="1.7650000000000001, 5.96, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(6.125 : 3.46715413411458); (6.5 : 3.46715413411458)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/HiveExperiment/HiveExperiment_Job" />
-      <nodes>
-        <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
-        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
-      </nodes>
-    </associationConnector>
-    <classShape Id="cdddf4da-eaef-46a1-9cfd-987bb6b3d03e" absoluteBounds="17, 3.125, 2.5, 1.7708968098958327">
-      <DataClassMoniker Name="/HiveDataContext/DeletedJobStatistics" />
-      <nestedChildShapes>
-        <elementListCompartment Id="b8738381-f696-4dba-a517-47e9cd96a9a6" absoluteBounds="17.015, 3.585, 2.4699999999999998, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="25442617-ff41-49a0-b5d5-4cbe0b2f0f45" absoluteBounds="22, 4.5, 2, 1.9631982421874996">
-      <DataClassMoniker Name="/HiveDataContext/UserStatistics" />
-      <nestedChildShapes>
-        <elementListCompartment Id="6edf08e7-054a-4253-8d4f-5bf2dfec2d29" absoluteBounds="22.015, 4.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="f78ec989-4862-4bac-87e3-9b0aad4bc037" absoluteBounds="19.875, 4.5, 2, 2.1554996744791666">
-      <DataClassMoniker Name="/HiveDataContext/SlaveStatistics" />
-      <nestedChildShapes>
-        <elementListCompartment Id="98cb46fe-820e-4041-aee8-04e8bed3df23" absoluteBounds="19.89, 4.96, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" absoluteBounds="21, 3, 2, 1.1939925130208327">
-      <DataClassMoniker Name="/HiveDataContext/Statistics" />
-      <nestedChildShapes>
-        <elementListCompartment Id="17821282-8edf-40b7-9065-84f53391d5c1" absoluteBounds="21.015, 3.46, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(21.4375 : 4.19399251302083); (21.4375 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Statistics/Statistics_SlaveStatistics" />
-      <nodes>
-        <classShapeMoniker Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" />
-        <classShapeMoniker Id="f78ec989-4862-4bac-87e3-9b0aad4bc037" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(22.5 : 4.19399251302083); (22.5 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Statistics/Statistics_UserStatistics" />
-      <nodes>
-        <classShapeMoniker Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" />
-        <classShapeMoniker Id="25442617-ff41-49a0-b5d5-4cbe0b2f0f45" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.64829952604167); (13.5 : 3.64829952604167)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Downtime" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" />
-      </nodes>
-    </associationConnector>
-  </nestedChildShapes>
-</ordesignerObjectsDiagram>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs	(revision 6700)
+++ 	(revision )
@@ -1,4202 +1,0 @@
-﻿#pragma warning disable 1591
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.235
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace HeuristicLab.Services.Hive.DataAccess
-{
-	using System.Data.Linq;
-	using System.Data.Linq.Mapping;
-	using System.Data;
-	using System.Collections.Generic;
-	using System.Reflection;
-	using System.Linq;
-	using System.Linq.Expressions;
-	using System.ComponentModel;
-	using System;
-	
-	
-	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="HeuristicLab.Hive")]
-	public partial class HiveDataContext : System.Data.Linq.DataContext
-	{
-		
-		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
-		
-    #region Extensibility Method Definitions
-    partial void OnCreated();
-    partial void InsertAssignedResource(AssignedResource instance);
-    partial void UpdateAssignedResource(AssignedResource instance);
-    partial void DeleteAssignedResource(AssignedResource instance);
-    partial void InsertPlugin(Plugin instance);
-    partial void UpdatePlugin(Plugin instance);
-    partial void DeletePlugin(Plugin instance);
-    partial void InsertRequiredPlugin(RequiredPlugin instance);
-    partial void UpdateRequiredPlugin(RequiredPlugin instance);
-    partial void DeleteRequiredPlugin(RequiredPlugin instance);
-    partial void InsertResource(Resource instance);
-    partial void UpdateResource(Resource instance);
-    partial void DeleteResource(Resource instance);
-    partial void InsertJob(Job instance);
-    partial void UpdateJob(Job instance);
-    partial void DeleteJob(Job instance);
-    partial void InsertDowntime(Downtime instance);
-    partial void UpdateDowntime(Downtime instance);
-    partial void DeleteDowntime(Downtime instance);
-    partial void InsertHiveExperiment(HiveExperiment instance);
-    partial void UpdateHiveExperiment(HiveExperiment instance);
-    partial void DeleteHiveExperiment(HiveExperiment instance);
-    partial void InsertJobData(JobData instance);
-    partial void UpdateJobData(JobData instance);
-    partial void DeleteJobData(JobData instance);
-    partial void InsertPluginData(PluginData instance);
-    partial void UpdatePluginData(PluginData instance);
-    partial void DeletePluginData(PluginData instance);
-    partial void InsertStateLog(StateLog instance);
-    partial void UpdateStateLog(StateLog instance);
-    partial void DeleteStateLog(StateLog instance);
-    partial void InsertHiveExperimentPermission(HiveExperimentPermission instance);
-    partial void UpdateHiveExperimentPermission(HiveExperimentPermission instance);
-    partial void DeleteHiveExperimentPermission(HiveExperimentPermission instance);
-    partial void InsertLifecycle(Lifecycle instance);
-    partial void UpdateLifecycle(Lifecycle instance);
-    partial void DeleteLifecycle(Lifecycle instance);
-    partial void InsertDeletedJobStatistics(DeletedJobStatistics instance);
-    partial void UpdateDeletedJobStatistics(DeletedJobStatistics instance);
-    partial void DeleteDeletedJobStatistics(DeletedJobStatistics instance);
-    partial void InsertUserStatistics(UserStatistics instance);
-    partial void UpdateUserStatistics(UserStatistics instance);
-    partial void DeleteUserStatistics(UserStatistics instance);
-    partial void InsertSlaveStatistics(SlaveStatistics instance);
-    partial void UpdateSlaveStatistics(SlaveStatistics instance);
-    partial void DeleteSlaveStatistics(SlaveStatistics instance);
-    partial void InsertStatistics(Statistics instance);
-    partial void UpdateStatistics(Statistics instance);
-    partial void DeleteStatistics(Statistics instance);
-    #endregion
-		
-		public HiveDataContext() : 
-				base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)
-		{
-			OnCreated();
-		}
-		
-		public HiveDataContext(string connection) : 
-				base(connection, mappingSource)
-		{
-			OnCreated();
-		}
-		
-		public HiveDataContext(System.Data.IDbConnection connection) : 
-				base(connection, mappingSource)
-		{
-			OnCreated();
-		}
-		
-		public HiveDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
-				base(connection, mappingSource)
-		{
-			OnCreated();
-		}
-		
-		public HiveDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
-				base(connection, mappingSource)
-		{
-			OnCreated();
-		}
-		
-		public System.Data.Linq.Table<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this.GetTable<AssignedResource>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Plugin> Plugins
-		{
-			get
-			{
-				return this.GetTable<Plugin>();
-			}
-		}
-		
-		public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
-		{
-			get
-			{
-				return this.GetTable<RequiredPlugin>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Resource> Resources
-		{
-			get
-			{
-				return this.GetTable<Resource>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Job> Jobs
-		{
-			get
-			{
-				return this.GetTable<Job>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Downtime> Downtimes
-		{
-			get
-			{
-				return this.GetTable<Downtime>();
-			}
-		}
-		
-		public System.Data.Linq.Table<HiveExperiment> HiveExperiments
-		{
-			get
-			{
-				return this.GetTable<HiveExperiment>();
-			}
-		}
-		
-		public System.Data.Linq.Table<JobData> JobDatas
-		{
-			get
-			{
-				return this.GetTable<JobData>();
-			}
-		}
-		
-		public System.Data.Linq.Table<PluginData> PluginDatas
-		{
-			get
-			{
-				return this.GetTable<PluginData>();
-			}
-		}
-		
-		public System.Data.Linq.Table<StateLog> StateLogs
-		{
-			get
-			{
-				return this.GetTable<StateLog>();
-			}
-		}
-		
-		public System.Data.Linq.Table<HiveExperimentPermission> HiveExperimentPermissions
-		{
-			get
-			{
-				return this.GetTable<HiveExperimentPermission>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Lifecycle> Lifecycles
-		{
-			get
-			{
-				return this.GetTable<Lifecycle>();
-			}
-		}
-		
-		public System.Data.Linq.Table<DeletedJobStatistics> DeletedJobStatistics
-		{
-			get
-			{
-				return this.GetTable<DeletedJobStatistics>();
-			}
-		}
-		
-		public System.Data.Linq.Table<UserStatistics> UserStatistics
-		{
-			get
-			{
-				return this.GetTable<UserStatistics>();
-			}
-		}
-		
-		public System.Data.Linq.Table<SlaveStatistics> SlaveStatistics
-		{
-			get
-			{
-				return this.GetTable<SlaveStatistics>();
-			}
-		}
-		
-		public System.Data.Linq.Table<Statistics> Statistics
-		{
-			get
-			{
-				return this.GetTable<Statistics>();
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResources")]
-	public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _ResourceId;
-		
-		private System.Guid _JobId;
-		
-		private EntityRef<Resource> _Resource;
-		
-		private EntityRef<Job> _Job;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnResourceIdChanging(System.Guid value);
-    partial void OnResourceIdChanged();
-    partial void OnJobIdChanging(System.Guid value);
-    partial void OnJobIdChanged();
-    #endregion
-		
-		public AssignedResource()
-		{
-			this._Resource = default(EntityRef<Resource>);
-			this._Job = default(EntityRef<Job>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid ResourceId
-		{
-			get
-			{
-				return this._ResourceId;
-			}
-			set
-			{
-				if ((this._ResourceId != value))
-				{
-					if (this._Resource.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceId = value;
-					this.SendPropertyChanged("ResourceId");
-					this.OnResourceIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid JobId
-		{
-			get
-			{
-				return this._JobId;
-			}
-			set
-			{
-				if ((this._JobId != value))
-				{
-					if (this._Job.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._JobId = value;
-					this.SendPropertyChanged("JobId");
-					this.OnJobIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
-		public Resource Resource
-		{
-			get
-			{
-				return this._Resource.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._Resource.Entity;
-				if (((previousValue != value) 
-							|| (this._Resource.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Resource.Entity = null;
-						previousValue.AssignedResources.Remove(this);
-					}
-					this._Resource.Entity = value;
-					if ((value != null))
-					{
-						value.AssignedResources.Add(this);
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Resource");
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")]
-		public Job Job
-		{
-			get
-			{
-				return this._Job.Entity;
-			}
-			set
-			{
-				Job previousValue = this._Job.Entity;
-				if (((previousValue != value) 
-							|| (this._Job.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Job.Entity = null;
-						previousValue.AssignedResources.Remove(this);
-					}
-					this._Job.Entity = value;
-					if ((value != null))
-					{
-						value.AssignedResources.Add(this);
-						this._JobId = value.JobId;
-					}
-					else
-					{
-						this._JobId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Job");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Plugin")]
-	public partial class Plugin : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _PluginId;
-		
-		private string _Name;
-		
-		private string _Version;
-		
-		private System.Guid _UserId;
-		
-		private System.DateTime _DateCreated;
-		
-		private byte[] _Hash;
-		
-		private EntitySet<RequiredPlugin> _RequiredPlugins;
-		
-		private EntitySet<PluginData> _PluginData;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnPluginIdChanging(System.Guid value);
-    partial void OnPluginIdChanged();
-    partial void OnNameChanging(string value);
-    partial void OnNameChanged();
-    partial void OnVersionChanging(string value);
-    partial void OnVersionChanged();
-    partial void OnUserIdChanging(System.Guid value);
-    partial void OnUserIdChanged();
-    partial void OnDateCreatedChanging(System.DateTime value);
-    partial void OnDateCreatedChanged();
-    partial void OnHashChanging(byte[] value);
-    partial void OnHashChanged();
-    #endregion
-		
-		public Plugin()
-		{
-			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
-			this._PluginData = new EntitySet<PluginData>(new Action<PluginData>(this.attach_PluginData), new Action<PluginData>(this.detach_PluginData));
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid PluginId
-		{
-			get
-			{
-				return this._PluginId;
-			}
-			set
-			{
-				if ((this._PluginId != value))
-				{
-					this.OnPluginIdChanging(value);
-					this.SendPropertyChanging();
-					this._PluginId = value;
-					this.SendPropertyChanged("PluginId");
-					this.OnPluginIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
-		public string Name
-		{
-			get
-			{
-				return this._Name;
-			}
-			set
-			{
-				if ((this._Name != value))
-				{
-					this.OnNameChanging(value);
-					this.SendPropertyChanging();
-					this._Name = value;
-					this.SendPropertyChanged("Name");
-					this.OnNameChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Version", DbType="VarChar(MAX)", CanBeNull=false)]
-		public string Version
-		{
-			get
-			{
-				return this._Version;
-			}
-			set
-			{
-				if ((this._Version != value))
-				{
-					this.OnVersionChanging(value);
-					this.SendPropertyChanging();
-					this._Version = value;
-					this.SendPropertyChanged("Version");
-					this.OnVersionChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
-		public System.Guid UserId
-		{
-			get
-			{
-				return this._UserId;
-			}
-			set
-			{
-				if ((this._UserId != value))
-				{
-					this.OnUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._UserId = value;
-					this.SendPropertyChanged("UserId");
-					this.OnUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
-		public System.DateTime DateCreated
-		{
-			get
-			{
-				return this._DateCreated;
-			}
-			set
-			{
-				if ((this._DateCreated != value))
-				{
-					this.OnDateCreatedChanging(value);
-					this.SendPropertyChanging();
-					this._DateCreated = value;
-					this.SendPropertyChanged("DateCreated");
-					this.OnDateCreatedChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hash", DbType="VarBinary(20) NOT NULL", CanBeNull=false)]
-		public byte[] Hash
-		{
-			get
-			{
-				return this._Hash;
-			}
-			set
-			{
-				if ((this._Hash != value))
-				{
-					this.OnHashChanging(value);
-					this.SendPropertyChanging();
-					this._Hash = value;
-					this.SendPropertyChanged("Hash");
-					this.OnHashChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="PluginId", OtherKey="PluginId")]
-		public EntitySet<RequiredPlugin> RequiredPlugins
-		{
-			get
-			{
-				return this._RequiredPlugins;
-			}
-			set
-			{
-				this._RequiredPlugins.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_PluginData", ThisKey="PluginId", OtherKey="PluginId")]
-		public EntitySet<PluginData> PluginData
-		{
-			get
-			{
-				return this._PluginData;
-			}
-			set
-			{
-				this._PluginData.Assign(value);
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_RequiredPlugins(RequiredPlugin entity)
-		{
-			this.SendPropertyChanging();
-			entity.Plugin = this;
-		}
-		
-		private void detach_RequiredPlugins(RequiredPlugin entity)
-		{
-			this.SendPropertyChanging();
-			entity.Plugin = null;
-		}
-		
-		private void attach_PluginData(PluginData entity)
-		{
-			this.SendPropertyChanging();
-			entity.Plugin = this;
-		}
-		
-		private void detach_PluginData(PluginData entity)
-		{
-			this.SendPropertyChanging();
-			entity.Plugin = null;
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RequiredPlugins")]
-	public partial class RequiredPlugin : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _RequiredPluginId;
-		
-		private System.Guid _JobId;
-		
-		private System.Guid _PluginId;
-		
-		private EntityRef<Plugin> _PluginInfo;
-		
-		private EntityRef<Job> _Job;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnRequiredPluginIdChanging(System.Guid value);
-    partial void OnRequiredPluginIdChanged();
-    partial void OnJobIdChanging(System.Guid value);
-    partial void OnJobIdChanged();
-    partial void OnPluginIdChanging(System.Guid value);
-    partial void OnPluginIdChanged();
-    #endregion
-		
-		public RequiredPlugin()
-		{
-			this._PluginInfo = default(EntityRef<Plugin>);
-			this._Job = default(EntityRef<Job>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RequiredPluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
-		public System.Guid RequiredPluginId
-		{
-			get
-			{
-				return this._RequiredPluginId;
-			}
-			set
-			{
-				if ((this._RequiredPluginId != value))
-				{
-					this.OnRequiredPluginIdChanging(value);
-					this.SendPropertyChanging();
-					this._RequiredPluginId = value;
-					this.SendPropertyChanged("RequiredPluginId");
-					this.OnRequiredPluginIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid JobId
-		{
-			get
-			{
-				return this._JobId;
-			}
-			set
-			{
-				if ((this._JobId != value))
-				{
-					if (this._Job.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._JobId = value;
-					this.SendPropertyChanged("JobId");
-					this.OnJobIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid PluginId
-		{
-			get
-			{
-				return this._PluginId;
-			}
-			set
-			{
-				if ((this._PluginId != value))
-				{
-					if (this._PluginInfo.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnPluginIdChanging(value);
-					this.SendPropertyChanging();
-					this._PluginId = value;
-					this.SendPropertyChanged("PluginId");
-					this.OnPluginIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")]
-		public Plugin Plugin
-		{
-			get
-			{
-				return this._PluginInfo.Entity;
-			}
-			set
-			{
-				Plugin previousValue = this._PluginInfo.Entity;
-				if (((previousValue != value) 
-							|| (this._PluginInfo.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._PluginInfo.Entity = null;
-						previousValue.RequiredPlugins.Remove(this);
-					}
-					this._PluginInfo.Entity = value;
-					if ((value != null))
-					{
-						value.RequiredPlugins.Add(this);
-						this._PluginId = value.PluginId;
-					}
-					else
-					{
-						this._PluginId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Plugin");
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
-		public Job Job
-		{
-			get
-			{
-				return this._Job.Entity;
-			}
-			set
-			{
-				Job previousValue = this._Job.Entity;
-				if (((previousValue != value) 
-							|| (this._Job.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Job.Entity = null;
-						previousValue.RequiredPlugins.Remove(this);
-					}
-					this._Job.Entity = value;
-					if ((value != null))
-					{
-						value.RequiredPlugins.Add(this);
-						this._JobId = value.JobId;
-					}
-					else
-					{
-						this._JobId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Job");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Resource")]
-	[global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="RESOURCE", Type=typeof(Resource))]
-	[global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="Slave", Type=typeof(Slave), IsDefault=true)]
-	[global::System.Data.Linq.Mapping.InheritanceMappingAttribute(Code="GROUP", Type=typeof(SlaveGroup))]
-	public partial class Resource : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _ResourceId;
-		
-		private string _Name;
-		
-		private string _ResourceType;
-		
-		private System.Nullable<System.Guid> _ParentResourceId;
-		
-		private EntitySet<AssignedResource> _AssignedResources;
-		
-		private EntitySet<Resource> _ChildResources;
-		
-		private EntitySet<Downtime> _UptimeCalendars;
-		
-		private EntitySet<StateLog> _StateLogs;
-		
-		private EntityRef<Resource> _ParentResource;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnResourceIdChanging(System.Guid value);
-    partial void OnResourceIdChanged();
-    partial void OnNameChanging(string value);
-    partial void OnNameChanged();
-    partial void OnResourceTypeChanging(string value);
-    partial void OnResourceTypeChanged();
-    partial void OnParentResourceIdChanging(System.Nullable<System.Guid> value);
-    partial void OnParentResourceIdChanged();
-    #endregion
-		
-		public Resource()
-		{
-			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
-			this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
-			this._UptimeCalendars = new EntitySet<Downtime>(new Action<Downtime>(this.attach_UptimeCalendars), new Action<Downtime>(this.detach_UptimeCalendars));
-			this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
-			this._ParentResource = default(EntityRef<Resource>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid ResourceId
-		{
-			get
-			{
-				return this._ResourceId;
-			}
-			set
-			{
-				if ((this._ResourceId != value))
-				{
-					this.OnResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceId = value;
-					this.SendPropertyChanged("ResourceId");
-					this.OnResourceIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
-		public string Name
-		{
-			get
-			{
-				return this._Name;
-			}
-			set
-			{
-				if ((this._Name != value))
-				{
-					this.OnNameChanging(value);
-					this.SendPropertyChanging();
-					this._Name = value;
-					this.SendPropertyChanged("Name");
-					this.OnNameChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceType", CanBeNull=false, IsDiscriminator=true)]
-		public string ResourceType
-		{
-			get
-			{
-				return this._ResourceType;
-			}
-			set
-			{
-				if ((this._ResourceType != value))
-				{
-					this.OnResourceTypeChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceType = value;
-					this.SendPropertyChanged("ResourceType");
-					this.OnResourceTypeChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentResourceId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ParentResourceId
-		{
-			get
-			{
-				return this._ParentResourceId;
-			}
-			set
-			{
-				if ((this._ParentResourceId != value))
-				{
-					if (this._ParentResource.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnParentResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ParentResourceId = value;
-					this.SendPropertyChanged("ParentResourceId");
-					this.OnParentResourceIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
-		public EntitySet<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this._AssignedResources;
-			}
-			set
-			{
-				this._AssignedResources.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ChildResources", ThisKey="ResourceId", OtherKey="ParentResourceId")]
-		public EntitySet<Resource> ChildResources
-		{
-			get
-			{
-				return this._ChildResources;
-			}
-			set
-			{
-				this._ChildResources.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
-		public EntitySet<Downtime> Downtimes
-		{
-			get
-			{
-				return this._UptimeCalendars;
-			}
-			set
-			{
-				this._UptimeCalendars.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_StateLog", Storage="_StateLogs", ThisKey="ResourceId", OtherKey="SlaveId")]
-		public EntitySet<StateLog> StateLogs
-		{
-			get
-			{
-				return this._StateLogs;
-			}
-			set
-			{
-				this._StateLogs.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Resource", Storage="_ParentResource", ThisKey="ParentResourceId", OtherKey="ResourceId", IsForeignKey=true)]
-		public Resource ParentResource
-		{
-			get
-			{
-				return this._ParentResource.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._ParentResource.Entity;
-				if (((previousValue != value) 
-							|| (this._ParentResource.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._ParentResource.Entity = null;
-						previousValue.ChildResources.Remove(this);
-					}
-					this._ParentResource.Entity = value;
-					if ((value != null))
-					{
-						value.ChildResources.Add(this);
-						this._ParentResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ParentResourceId = default(Nullable<System.Guid>);
-					}
-					this.SendPropertyChanged("ParentResource");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = this;
-		}
-		
-		private void detach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = null;
-		}
-		
-		private void attach_ChildResources(Resource entity)
-		{
-			this.SendPropertyChanging();
-			entity.ParentResource = this;
-		}
-		
-		private void detach_ChildResources(Resource entity)
-		{
-			this.SendPropertyChanging();
-			entity.ParentResource = null;
-		}
-		
-		private void attach_UptimeCalendars(Downtime entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = this;
-		}
-		
-		private void detach_UptimeCalendars(Downtime entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = null;
-		}
-		
-		private void attach_StateLogs(StateLog entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = this;
-		}
-		
-		private void detach_StateLogs(StateLog entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = null;
-		}
-	}
-	
-	public partial class Slave : Resource
-	{
-		
-		private System.Nullable<int> _CPUSpeed;
-		
-		private System.Nullable<int> _Memory;
-		
-		private System.Nullable<System.DateTime> _Login;
-		
-		private global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState _Status;
-		
-		private System.Nullable<int> _NumberOfCores;
-		
-		private System.Nullable<int> _NumberOfFreeCores;
-		
-		private System.Nullable<int> _FreeMemory;
-		
-		private bool _IsAllowedToCalculate;
-		
-		private global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture _CpuArchitecture;
-		
-		private string _OperatingSystem;
-		
-		private System.Nullable<System.DateTime> _LastHeartbeat;
-		
-		private double _CpuUtilization;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnCpuSpeedChanging(System.Nullable<int> value);
-    partial void OnCpuSpeedChanged();
-    partial void OnMemoryChanging(System.Nullable<int> value);
-    partial void OnMemoryChanged();
-    partial void OnLoginChanging(System.Nullable<System.DateTime> value);
-    partial void OnLoginChanged();
-    partial void OnSlaveStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState value);
-    partial void OnSlaveStateChanged();
-    partial void OnCoresChanging(System.Nullable<int> value);
-    partial void OnCoresChanged();
-    partial void OnFreeCoresChanging(System.Nullable<int> value);
-    partial void OnFreeCoresChanged();
-    partial void OnFreeMemoryChanging(System.Nullable<int> value);
-    partial void OnFreeMemoryChanged();
-    partial void OnIsAllowedToCalculateChanging(bool value);
-    partial void OnIsAllowedToCalculateChanged();
-    partial void OnCpuArchitectureChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture value);
-    partial void OnCpuArchitectureChanged();
-    partial void OnOperatingSystemChanging(string value);
-    partial void OnOperatingSystemChanged();
-    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
-    partial void OnLastHeartbeatChanged();
-    partial void OnCpuUtilizationChanging(double value);
-    partial void OnCpuUtilizationChanged();
-    #endregion
-		
-		public Slave()
-		{
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CPUSpeed", DbType="Int")]
-		public System.Nullable<int> CpuSpeed
-		{
-			get
-			{
-				return this._CPUSpeed;
-			}
-			set
-			{
-				if ((this._CPUSpeed != value))
-				{
-					this.OnCpuSpeedChanging(value);
-					this.SendPropertyChanging();
-					this._CPUSpeed = value;
-					this.SendPropertyChanged("CpuSpeed");
-					this.OnCpuSpeedChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Memory", DbType="Int")]
-		public System.Nullable<int> Memory
-		{
-			get
-			{
-				return this._Memory;
-			}
-			set
-			{
-				if ((this._Memory != value))
-				{
-					this.OnMemoryChanging(value);
-					this.SendPropertyChanging();
-					this._Memory = value;
-					this.SendPropertyChanged("Memory");
-					this.OnMemoryChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="DateTime")]
-		public System.Nullable<System.DateTime> Login
-		{
-			get
-			{
-				return this._Login;
-			}
-			set
-			{
-				if ((this._Login != value))
-				{
-					this.OnLoginChanging(value);
-					this.SendPropertyChanging();
-					this._Login = value;
-					this.SendPropertyChanged("Login");
-					this.OnLoginChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Status", DbType="VarChar(15)", CanBeNull=true)]
-		public global::HeuristicLab.Services.Hive.Common.DataTransfer.SlaveState SlaveState
-		{
-			get
-			{
-				return this._Status;
-			}
-			set
-			{
-				if ((this._Status != value))
-				{
-					this.OnSlaveStateChanging(value);
-					this.SendPropertyChanging();
-					this._Status = value;
-					this.SendPropertyChanged("SlaveState");
-					this.OnSlaveStateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfCores", DbType="Int")]
-		public System.Nullable<int> Cores
-		{
-			get
-			{
-				return this._NumberOfCores;
-			}
-			set
-			{
-				if ((this._NumberOfCores != value))
-				{
-					this.OnCoresChanging(value);
-					this.SendPropertyChanging();
-					this._NumberOfCores = value;
-					this.SendPropertyChanged("Cores");
-					this.OnCoresChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumberOfFreeCores", DbType="Int")]
-		public System.Nullable<int> FreeCores
-		{
-			get
-			{
-				return this._NumberOfFreeCores;
-			}
-			set
-			{
-				if ((this._NumberOfFreeCores != value))
-				{
-					this.OnFreeCoresChanging(value);
-					this.SendPropertyChanging();
-					this._NumberOfFreeCores = value;
-					this.SendPropertyChanged("FreeCores");
-					this.OnFreeCoresChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeMemory", DbType="Int")]
-		public System.Nullable<int> FreeMemory
-		{
-			get
-			{
-				return this._FreeMemory;
-			}
-			set
-			{
-				if ((this._FreeMemory != value))
-				{
-					this.OnFreeMemoryChanging(value);
-					this.SendPropertyChanging();
-					this._FreeMemory = value;
-					this.SendPropertyChanged("FreeMemory");
-					this.OnFreeMemoryChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsAllowedToCalculate", DbType="Bit")]
-		public bool IsAllowedToCalculate
-		{
-			get
-			{
-				return this._IsAllowedToCalculate;
-			}
-			set
-			{
-				if ((this._IsAllowedToCalculate != value))
-				{
-					this.OnIsAllowedToCalculateChanging(value);
-					this.SendPropertyChanging();
-					this._IsAllowedToCalculate = value;
-					this.SendPropertyChanged("IsAllowedToCalculate");
-					this.OnIsAllowedToCalculateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuArchitecture", DbType="VarChar(3)", CanBeNull=false)]
-		public global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture CpuArchitecture
-		{
-			get
-			{
-				return this._CpuArchitecture;
-			}
-			set
-			{
-				if ((this._CpuArchitecture != value))
-				{
-					this.OnCpuArchitectureChanging(value);
-					this.SendPropertyChanging();
-					this._CpuArchitecture = value;
-					this.SendPropertyChanged("CpuArchitecture");
-					this.OnCpuArchitectureChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OperatingSystem", DbType="VarChar(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
-		public string OperatingSystem
-		{
-			get
-			{
-				return this._OperatingSystem;
-			}
-			set
-			{
-				if ((this._OperatingSystem != value))
-				{
-					this.OnOperatingSystemChanging(value);
-					this.SendPropertyChanging();
-					this._OperatingSystem = value;
-					this.SendPropertyChanged("OperatingSystem");
-					this.OnOperatingSystemChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastHeartbeat", DbType="DateTime")]
-		public System.Nullable<System.DateTime> LastHeartbeat
-		{
-			get
-			{
-				return this._LastHeartbeat;
-			}
-			set
-			{
-				if ((this._LastHeartbeat != value))
-				{
-					this.OnLastHeartbeatChanging(value);
-					this.SendPropertyChanging();
-					this._LastHeartbeat = value;
-					this.SendPropertyChanged("LastHeartbeat");
-					this.OnLastHeartbeatChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuUtilization", DbType="float")]
-		public double CpuUtilization
-		{
-			get
-			{
-				return this._CpuUtilization;
-			}
-			set
-			{
-				if ((this._CpuUtilization != value))
-				{
-					this.OnCpuUtilizationChanging(value);
-					this.SendPropertyChanging();
-					this._CpuUtilization = value;
-					this.SendPropertyChanged("CpuUtilization");
-					this.OnCpuUtilizationChanged();
-				}
-			}
-		}
-	}
-	
-	public partial class SlaveGroup : Resource
-	{
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    #endregion
-		
-		public SlaveGroup()
-		{
-			OnCreated();
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Job")]
-	public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _JobId;
-		
-		private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _State;
-		
-		private double _ExecutionTime;
-		
-		private System.Nullable<System.DateTime> _LastHeartbeat;
-		
-		private System.Nullable<System.Guid> _ParentJobId;
-		
-		private int _Priority;
-		
-		private int _CoresNeeded;
-		
-		private int _MemoryNeeded;
-		
-		private bool _IsParentJob;
-		
-		private bool _FinishWhenChildJobsFinished;
-		
-		private global::HeuristicLab.Services.Hive.Common.DataTransfer.Command? _Command;
-		
-		private System.Guid _HiveExperimentId;
-		
-		private bool _IsPrivileged;
-		
-		private EntitySet<AssignedResource> _AssignedResources;
-		
-		private EntitySet<RequiredPlugin> _RequiredPlugins;
-		
-		private EntitySet<Job> _Jobs;
-		
-		private EntityRef<JobData> _JobData;
-		
-		private EntitySet<StateLog> _StateLogs;
-		
-		private EntityRef<Job> _Job1;
-		
-		private EntityRef<HiveExperiment> _HiveExperiment;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnJobIdChanging(System.Guid value);
-    partial void OnJobIdChanged();
-    partial void OnStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
-    partial void OnStateChanged();
-    partial void OnExecutionTimeMsChanging(double value);
-    partial void OnExecutionTimeMsChanged();
-    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
-    partial void OnLastHeartbeatChanged();
-    partial void OnParentJobIdChanging(System.Nullable<System.Guid> value);
-    partial void OnParentJobIdChanged();
-    partial void OnPriorityChanging(int value);
-    partial void OnPriorityChanged();
-    partial void OnCoresNeededChanging(int value);
-    partial void OnCoresNeededChanged();
-    partial void OnMemoryNeededChanging(int value);
-    partial void OnMemoryNeededChanged();
-    partial void OnIsParentJobChanging(bool value);
-    partial void OnIsParentJobChanged();
-    partial void OnFinishWhenChildJobsFinishedChanging(bool value);
-    partial void OnFinishWhenChildJobsFinishedChanged();
-    partial void OnCommandChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.Command? value);
-    partial void OnCommandChanged();
-    partial void OnHiveExperimentIdChanging(System.Guid value);
-    partial void OnHiveExperimentIdChanged();
-    partial void OnIsPrivilegedChanging(bool value);
-    partial void OnIsPrivilegedChanged();
-    #endregion
-		
-		public Job()
-		{
-			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
-			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
-			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
-			this._JobData = default(EntityRef<JobData>);
-			this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
-			this._Job1 = default(EntityRef<Job>);
-			this._HiveExperiment = default(EntityRef<HiveExperiment>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid JobId
-		{
-			get
-			{
-				return this._JobId;
-			}
-			set
-			{
-				if ((this._JobId != value))
-				{
-					this.OnJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._JobId = value;
-					this.SendPropertyChanged("JobId");
-					this.OnJobIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="JobState", Storage="_State", DbType="VarChar(30)", CanBeNull=false)]
-		public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState State
-		{
-			get
-			{
-				return this._State;
-			}
-			set
-			{
-				if ((this._State != value))
-				{
-					this.OnStateChanging(value);
-					this.SendPropertyChanging();
-					this._State = value;
-					this.SendPropertyChanged("State");
-					this.OnStateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float")]
-		public double ExecutionTimeMs
-		{
-			get
-			{
-				return this._ExecutionTime;
-			}
-			set
-			{
-				if ((this._ExecutionTime != value))
-				{
-					this.OnExecutionTimeMsChanging(value);
-					this.SendPropertyChanging();
-					this._ExecutionTime = value;
-					this.SendPropertyChanged("ExecutionTimeMs");
-					this.OnExecutionTimeMsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastHeartbeat", DbType="DateTime")]
-		public System.Nullable<System.DateTime> LastHeartbeat
-		{
-			get
-			{
-				return this._LastHeartbeat;
-			}
-			set
-			{
-				if ((this._LastHeartbeat != value))
-				{
-					this.OnLastHeartbeatChanging(value);
-					this.SendPropertyChanging();
-					this._LastHeartbeat = value;
-					this.SendPropertyChanged("LastHeartbeat");
-					this.OnLastHeartbeatChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentJobId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> ParentJobId
-		{
-			get
-			{
-				return this._ParentJobId;
-			}
-			set
-			{
-				if ((this._ParentJobId != value))
-				{
-					if (this._Job1.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnParentJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._ParentJobId = value;
-					this.SendPropertyChanged("ParentJobId");
-					this.OnParentJobIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Priority", DbType="Int NOT NULL")]
-		public int Priority
-		{
-			get
-			{
-				return this._Priority;
-			}
-			set
-			{
-				if ((this._Priority != value))
-				{
-					this.OnPriorityChanging(value);
-					this.SendPropertyChanging();
-					this._Priority = value;
-					this.SendPropertyChanged("Priority");
-					this.OnPriorityChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresNeeded", DbType="Int NOT NULL")]
-		public int CoresNeeded
-		{
-			get
-			{
-				return this._CoresNeeded;
-			}
-			set
-			{
-				if ((this._CoresNeeded != value))
-				{
-					this.OnCoresNeededChanging(value);
-					this.SendPropertyChanging();
-					this._CoresNeeded = value;
-					this.SendPropertyChanged("CoresNeeded");
-					this.OnCoresNeededChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MemoryNeeded", DbType="Int NOT NULL")]
-		public int MemoryNeeded
-		{
-			get
-			{
-				return this._MemoryNeeded;
-			}
-			set
-			{
-				if ((this._MemoryNeeded != value))
-				{
-					this.OnMemoryNeededChanging(value);
-					this.SendPropertyChanging();
-					this._MemoryNeeded = value;
-					this.SendPropertyChanged("MemoryNeeded");
-					this.OnMemoryNeededChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsParentJob", DbType="Bit")]
-		public bool IsParentJob
-		{
-			get
-			{
-				return this._IsParentJob;
-			}
-			set
-			{
-				if ((this._IsParentJob != value))
-				{
-					this.OnIsParentJobChanging(value);
-					this.SendPropertyChanging();
-					this._IsParentJob = value;
-					this.SendPropertyChanged("IsParentJob");
-					this.OnIsParentJobChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FinishWhenChildJobsFinished", DbType="Bit")]
-		public bool FinishWhenChildJobsFinished
-		{
-			get
-			{
-				return this._FinishWhenChildJobsFinished;
-			}
-			set
-			{
-				if ((this._FinishWhenChildJobsFinished != value))
-				{
-					this.OnFinishWhenChildJobsFinishedChanging(value);
-					this.SendPropertyChanging();
-					this._FinishWhenChildJobsFinished = value;
-					this.SendPropertyChanged("FinishWhenChildJobsFinished");
-					this.OnFinishWhenChildJobsFinishedChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Command", DbType="VarChar(30)", CanBeNull=true)]
-		public global::HeuristicLab.Services.Hive.Common.DataTransfer.Command? Command
-		{
-			get
-			{
-				return this._Command;
-			}
-			set
-			{
-				if ((this._Command != value))
-				{
-					this.OnCommandChanging(value);
-					this.SendPropertyChanging();
-					this._Command = value;
-					this.SendPropertyChanged("Command");
-					this.OnCommandChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid HiveExperimentId
-		{
-			get
-			{
-				return this._HiveExperimentId;
-			}
-			set
-			{
-				if ((this._HiveExperimentId != value))
-				{
-					if (this._HiveExperiment.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnHiveExperimentIdChanging(value);
-					this.SendPropertyChanging();
-					this._HiveExperimentId = value;
-					this.SendPropertyChanged("HiveExperimentId");
-					this.OnHiveExperimentIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsPrivileged", DbType="Bit")]
-		public bool IsPrivileged
-		{
-			get
-			{
-				return this._IsPrivileged;
-			}
-			set
-			{
-				if ((this._IsPrivileged != value))
-				{
-					this.OnIsPrivilegedChanging(value);
-					this.SendPropertyChanging();
-					this._IsPrivileged = value;
-					this.SendPropertyChanged("IsPrivileged");
-					this.OnIsPrivilegedChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
-		public EntitySet<AssignedResource> AssignedResources
-		{
-			get
-			{
-				return this._AssignedResources;
-			}
-			set
-			{
-				this._AssignedResources.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
-		public EntitySet<RequiredPlugin> RequiredPlugins
-		{
-			get
-			{
-				return this._RequiredPlugins;
-			}
-			set
-			{
-				this._RequiredPlugins.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
-		public EntitySet<Job> ChildJobs
-		{
-			get
-			{
-				return this._Jobs;
-			}
-			set
-			{
-				this._Jobs.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobData", Storage="_JobData", ThisKey="JobId", OtherKey="JobId", IsUnique=true, IsForeignKey=false)]
-		public JobData JobData
-		{
-			get
-			{
-				return this._JobData.Entity;
-			}
-			set
-			{
-				JobData previousValue = this._JobData.Entity;
-				if (((previousValue != value) 
-							|| (this._JobData.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._JobData.Entity = null;
-						previousValue.Job = null;
-					}
-					this._JobData.Entity = value;
-					if ((value != null))
-					{
-						value.Job = this;
-					}
-					this.SendPropertyChanged("JobData");
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_StateLog", Storage="_StateLogs", ThisKey="JobId", OtherKey="JobId")]
-		public EntitySet<StateLog> StateLogs
-		{
-			get
-			{
-				return this._StateLogs;
-			}
-			set
-			{
-				this._StateLogs.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
-		public Job ParentJob
-		{
-			get
-			{
-				return this._Job1.Entity;
-			}
-			set
-			{
-				Job previousValue = this._Job1.Entity;
-				if (((previousValue != value) 
-							|| (this._Job1.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Job1.Entity = null;
-						previousValue.ChildJobs.Remove(this);
-					}
-					this._Job1.Entity = value;
-					if ((value != null))
-					{
-						value.ChildJobs.Add(this);
-						this._ParentJobId = value.JobId;
-					}
-					else
-					{
-						this._ParentJobId = default(Nullable<System.Guid>);
-					}
-					this.SendPropertyChanged("ParentJob");
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_Job", Storage="_HiveExperiment", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId", IsForeignKey=true)]
-		public HiveExperiment HiveExperiment
-		{
-			get
-			{
-				return this._HiveExperiment.Entity;
-			}
-			set
-			{
-				HiveExperiment previousValue = this._HiveExperiment.Entity;
-				if (((previousValue != value) 
-							|| (this._HiveExperiment.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._HiveExperiment.Entity = null;
-						previousValue.Jobs.Remove(this);
-					}
-					this._HiveExperiment.Entity = value;
-					if ((value != null))
-					{
-						value.Jobs.Add(this);
-						this._HiveExperimentId = value.HiveExperimentId;
-					}
-					else
-					{
-						this._HiveExperimentId = default(System.Guid);
-					}
-					this.SendPropertyChanged("HiveExperiment");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = this;
-		}
-		
-		private void detach_AssignedResources(AssignedResource entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = null;
-		}
-		
-		private void attach_RequiredPlugins(RequiredPlugin entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = this;
-		}
-		
-		private void detach_RequiredPlugins(RequiredPlugin entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = null;
-		}
-		
-		private void attach_Jobs(Job entity)
-		{
-			this.SendPropertyChanging();
-			entity.ParentJob = this;
-		}
-		
-		private void detach_Jobs(Job entity)
-		{
-			this.SendPropertyChanging();
-			entity.ParentJob = null;
-		}
-		
-		private void attach_StateLogs(StateLog entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = this;
-		}
-		
-		private void detach_StateLogs(StateLog entity)
-		{
-			this.SendPropertyChanging();
-			entity.Job = null;
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Downtime")]
-	public partial class Downtime : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _UptimeCalendarId;
-		
-		private System.Guid _ResourceId;
-		
-		private System.DateTime _StartDate;
-		
-		private System.DateTime _EndDate;
-		
-		private bool _AllDayEvent;
-		
-		private bool _Recurring;
-		
-		private System.Guid _RecurringId;
-		
-		private EntityRef<Resource> _Resource;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnDowntimeIdChanging(System.Guid value);
-    partial void OnDowntimeIdChanged();
-    partial void OnResourceIdChanging(System.Guid value);
-    partial void OnResourceIdChanged();
-    partial void OnStartDateChanging(System.DateTime value);
-    partial void OnStartDateChanged();
-    partial void OnEndDateChanging(System.DateTime value);
-    partial void OnEndDateChanged();
-    partial void OnAllDayEventChanging(bool value);
-    partial void OnAllDayEventChanged();
-    partial void OnRecurringChanging(bool value);
-    partial void OnRecurringChanged();
-    partial void OnRecurringIdChanging(System.Guid value);
-    partial void OnRecurringIdChanged();
-    #endregion
-		
-		public Downtime()
-		{
-			this._Resource = default(EntityRef<Resource>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid DowntimeId
-		{
-			get
-			{
-				return this._UptimeCalendarId;
-			}
-			set
-			{
-				if ((this._UptimeCalendarId != value))
-				{
-					this.OnDowntimeIdChanging(value);
-					this.SendPropertyChanging();
-					this._UptimeCalendarId = value;
-					this.SendPropertyChanged("DowntimeId");
-					this.OnDowntimeIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier")]
-		public System.Guid ResourceId
-		{
-			get
-			{
-				return this._ResourceId;
-			}
-			set
-			{
-				if ((this._ResourceId != value))
-				{
-					if (this._Resource.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceId = value;
-					this.SendPropertyChanged("ResourceId");
-					this.OnResourceIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
-		public System.DateTime StartDate
-		{
-			get
-			{
-				return this._StartDate;
-			}
-			set
-			{
-				if ((this._StartDate != value))
-				{
-					this.OnStartDateChanging(value);
-					this.SendPropertyChanging();
-					this._StartDate = value;
-					this.SendPropertyChanged("StartDate");
-					this.OnStartDateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
-		public System.DateTime EndDate
-		{
-			get
-			{
-				return this._EndDate;
-			}
-			set
-			{
-				if ((this._EndDate != value))
-				{
-					this.OnEndDateChanging(value);
-					this.SendPropertyChanging();
-					this._EndDate = value;
-					this.SendPropertyChanged("EndDate");
-					this.OnEndDateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AllDayEvent", DbType="Bit")]
-		public bool AllDayEvent
-		{
-			get
-			{
-				return this._AllDayEvent;
-			}
-			set
-			{
-				if ((this._AllDayEvent != value))
-				{
-					this.OnAllDayEventChanging(value);
-					this.SendPropertyChanging();
-					this._AllDayEvent = value;
-					this.SendPropertyChanged("AllDayEvent");
-					this.OnAllDayEventChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Recurring", DbType="Bit")]
-		public bool Recurring
-		{
-			get
-			{
-				return this._Recurring;
-			}
-			set
-			{
-				if ((this._Recurring != value))
-				{
-					this.OnRecurringChanging(value);
-					this.SendPropertyChanging();
-					this._Recurring = value;
-					this.SendPropertyChanged("Recurring");
-					this.OnRecurringChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RecurringId", DbType="UniqueIdentifier")]
-		public System.Guid RecurringId
-		{
-			get
-			{
-				return this._RecurringId;
-			}
-			set
-			{
-				if ((this._RecurringId != value))
-				{
-					this.OnRecurringIdChanging(value);
-					this.SendPropertyChanging();
-					this._RecurringId = value;
-					this.SendPropertyChanged("RecurringId");
-					this.OnRecurringIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
-		public Resource Resource
-		{
-			get
-			{
-				return this._Resource.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._Resource.Entity;
-				if (((previousValue != value) 
-							|| (this._Resource.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Resource.Entity = null;
-						previousValue.Downtimes.Remove(this);
-					}
-					this._Resource.Entity = value;
-					if ((value != null))
-					{
-						value.Downtimes.Add(this);
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Resource");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HiveExperiment")]
-	public partial class HiveExperiment : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _HiveExperimentId;
-		
-		private string _Name;
-		
-		private string _Description;
-		
-		private string _ResourceIds;
-		
-		private System.Guid _UserId;
-		
-		private System.DateTime _DateCreated;
-		
-		private System.Nullable<System.DateTime> _LastAccessed;
-		
-		private bool _IsHiveEngine;
-		
-		private EntitySet<Job> _Jobs;
-		
-		private EntitySet<HiveExperimentPermission> _HiveExperimentPermissions;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnHiveExperimentIdChanging(System.Guid value);
-    partial void OnHiveExperimentIdChanged();
-    partial void OnNameChanging(string value);
-    partial void OnNameChanged();
-    partial void OnDescriptionChanging(string value);
-    partial void OnDescriptionChanged();
-    partial void OnResourceIdsChanging(string value);
-    partial void OnResourceIdsChanged();
-    partial void OnOwnerUserIdChanging(System.Guid value);
-    partial void OnOwnerUserIdChanged();
-    partial void OnDateCreatedChanging(System.DateTime value);
-    partial void OnDateCreatedChanged();
-    partial void OnLastAccessedChanging(System.Nullable<System.DateTime> value);
-    partial void OnLastAccessedChanged();
-    partial void OnIsHiveEngineChanging(bool value);
-    partial void OnIsHiveEngineChanged();
-    #endregion
-		
-		public HiveExperiment()
-		{
-			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
-			this._HiveExperimentPermissions = new EntitySet<HiveExperimentPermission>(new Action<HiveExperimentPermission>(this.attach_HiveExperimentPermissions), new Action<HiveExperimentPermission>(this.detach_HiveExperimentPermissions));
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid HiveExperimentId
-		{
-			get
-			{
-				return this._HiveExperimentId;
-			}
-			set
-			{
-				if ((this._HiveExperimentId != value))
-				{
-					this.OnHiveExperimentIdChanging(value);
-					this.SendPropertyChanging();
-					this._HiveExperimentId = value;
-					this.SendPropertyChanged("HiveExperimentId");
-					this.OnHiveExperimentIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)]
-		public string Name
-		{
-			get
-			{
-				return this._Name;
-			}
-			set
-			{
-				if ((this._Name != value))
-				{
-					this.OnNameChanging(value);
-					this.SendPropertyChanging();
-					this._Name = value;
-					this.SendPropertyChanged("Name");
-					this.OnNameChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="VarChar(MAX)")]
-		public string Description
-		{
-			get
-			{
-				return this._Description;
-			}
-			set
-			{
-				if ((this._Description != value))
-				{
-					this.OnDescriptionChanging(value);
-					this.SendPropertyChanging();
-					this._Description = value;
-					this.SendPropertyChanged("Description");
-					this.OnDescriptionChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceIds", DbType="VarChar(MAX)")]
-		public string ResourceIds
-		{
-			get
-			{
-				return this._ResourceIds;
-			}
-			set
-			{
-				if ((this._ResourceIds != value))
-				{
-					this.OnResourceIdsChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceIds = value;
-					this.SendPropertyChanged("ResourceIds");
-					this.OnResourceIdsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
-		public System.Guid OwnerUserId
-		{
-			get
-			{
-				return this._UserId;
-			}
-			set
-			{
-				if ((this._UserId != value))
-				{
-					this.OnOwnerUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._UserId = value;
-					this.SendPropertyChanged("OwnerUserId");
-					this.OnOwnerUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
-		public System.DateTime DateCreated
-		{
-			get
-			{
-				return this._DateCreated;
-			}
-			set
-			{
-				if ((this._DateCreated != value))
-				{
-					this.OnDateCreatedChanging(value);
-					this.SendPropertyChanging();
-					this._DateCreated = value;
-					this.SendPropertyChanged("DateCreated");
-					this.OnDateCreatedChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastAccessed", DbType="DateTime")]
-		public System.Nullable<System.DateTime> LastAccessed
-		{
-			get
-			{
-				return this._LastAccessed;
-			}
-			set
-			{
-				if ((this._LastAccessed != value))
-				{
-					this.OnLastAccessedChanging(value);
-					this.SendPropertyChanging();
-					this._LastAccessed = value;
-					this.SendPropertyChanged("LastAccessed");
-					this.OnLastAccessedChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsHiveEngine", DbType="Bit")]
-		public bool IsHiveEngine
-		{
-			get
-			{
-				return this._IsHiveEngine;
-			}
-			set
-			{
-				if ((this._IsHiveEngine != value))
-				{
-					this.OnIsHiveEngineChanging(value);
-					this.SendPropertyChanging();
-					this._IsHiveEngine = value;
-					this.SendPropertyChanged("IsHiveEngine");
-					this.OnIsHiveEngineChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_Job", Storage="_Jobs", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId")]
-		public EntitySet<Job> Jobs
-		{
-			get
-			{
-				return this._Jobs;
-			}
-			set
-			{
-				this._Jobs.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_HiveExperimentPermission", Storage="_HiveExperimentPermissions", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId")]
-		public EntitySet<HiveExperimentPermission> HiveExperimentPermissions
-		{
-			get
-			{
-				return this._HiveExperimentPermissions;
-			}
-			set
-			{
-				this._HiveExperimentPermissions.Assign(value);
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_Jobs(Job entity)
-		{
-			this.SendPropertyChanging();
-			entity.HiveExperiment = this;
-		}
-		
-		private void detach_Jobs(Job entity)
-		{
-			this.SendPropertyChanging();
-			entity.HiveExperiment = null;
-		}
-		
-		private void attach_HiveExperimentPermissions(HiveExperimentPermission entity)
-		{
-			this.SendPropertyChanging();
-			entity.HiveExperiment = this;
-		}
-		
-		private void detach_HiveExperimentPermissions(HiveExperimentPermission entity)
-		{
-			this.SendPropertyChanging();
-			entity.HiveExperiment = null;
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.JobData")]
-	public partial class JobData : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _JobId;
-		
-		private System.Data.Linq.Binary _Data;
-		
-		private System.DateTime _LastUpdate;
-		
-		private EntityRef<Job> _Job;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnJobIdChanging(System.Guid value);
-    partial void OnJobIdChanged();
-    partial void OnDataChanging(System.Data.Linq.Binary value);
-    partial void OnDataChanged();
-    partial void OnLastUpdateChanging(System.DateTime value);
-    partial void OnLastUpdateChanged();
-    #endregion
-		
-		public JobData()
-		{
-			this._Job = default(EntityRef<Job>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid JobId
-		{
-			get
-			{
-				return this._JobId;
-			}
-			set
-			{
-				if ((this._JobId != value))
-				{
-					if (this._Job.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._JobId = value;
-					this.SendPropertyChanged("JobId");
-					this.OnJobIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="VarBinary(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
-		public System.Data.Linq.Binary Data
-		{
-			get
-			{
-				return this._Data;
-			}
-			set
-			{
-				if ((this._Data != value))
-				{
-					this.OnDataChanging(value);
-					this.SendPropertyChanging();
-					this._Data = value;
-					this.SendPropertyChanged("Data");
-					this.OnDataChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastUpdate", DbType="DateTime")]
-		public System.DateTime LastUpdate
-		{
-			get
-			{
-				return this._LastUpdate;
-			}
-			set
-			{
-				if ((this._LastUpdate != value))
-				{
-					this.OnLastUpdateChanging(value);
-					this.SendPropertyChanging();
-					this._LastUpdate = value;
-					this.SendPropertyChanged("LastUpdate");
-					this.OnLastUpdateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobData", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
-		public Job Job
-		{
-			get
-			{
-				return this._Job.Entity;
-			}
-			set
-			{
-				Job previousValue = this._Job.Entity;
-				if (((previousValue != value) 
-							|| (this._Job.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Job.Entity = null;
-						previousValue.JobData = null;
-					}
-					this._Job.Entity = value;
-					if ((value != null))
-					{
-						value.JobData = this;
-						this._JobId = value.JobId;
-					}
-					else
-					{
-						this._JobId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Job");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PluginData")]
-	public partial class PluginData : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _PluginDataId;
-		
-		private System.Guid _PluginId;
-		
-		private System.Data.Linq.Binary _Data;
-		
-		private string _FileName;
-		
-		private EntityRef<Plugin> _Plugin;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnPluginDataIdChanging(System.Guid value);
-    partial void OnPluginDataIdChanged();
-    partial void OnPluginIdChanging(System.Guid value);
-    partial void OnPluginIdChanged();
-    partial void OnDataChanging(System.Data.Linq.Binary value);
-    partial void OnDataChanged();
-    partial void OnFileNameChanging(string value);
-    partial void OnFileNameChanged();
-    #endregion
-		
-		public PluginData()
-		{
-			this._Plugin = default(EntityRef<Plugin>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginDataId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid PluginDataId
-		{
-			get
-			{
-				return this._PluginDataId;
-			}
-			set
-			{
-				if ((this._PluginDataId != value))
-				{
-					this.OnPluginDataIdChanging(value);
-					this.SendPropertyChanging();
-					this._PluginDataId = value;
-					this.SendPropertyChanged("PluginDataId");
-					this.OnPluginDataIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid PluginId
-		{
-			get
-			{
-				return this._PluginId;
-			}
-			set
-			{
-				if ((this._PluginId != value))
-				{
-					if (this._Plugin.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnPluginIdChanging(value);
-					this.SendPropertyChanging();
-					this._PluginId = value;
-					this.SendPropertyChanged("PluginId");
-					this.OnPluginIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="VarBinary(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
-		public System.Data.Linq.Binary Data
-		{
-			get
-			{
-				return this._Data;
-			}
-			set
-			{
-				if ((this._Data != value))
-				{
-					this.OnDataChanging(value);
-					this.SendPropertyChanging();
-					this._Data = value;
-					this.SendPropertyChanged("Data");
-					this.OnDataChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FileName", DbType="VarChar(MAX)", CanBeNull=false)]
-		public string FileName
-		{
-			get
-			{
-				return this._FileName;
-			}
-			set
-			{
-				if ((this._FileName != value))
-				{
-					this.OnFileNameChanging(value);
-					this.SendPropertyChanging();
-					this._FileName = value;
-					this.SendPropertyChanged("FileName");
-					this.OnFileNameChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Plugin_PluginData", Storage="_Plugin", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true)]
-		public Plugin Plugin
-		{
-			get
-			{
-				return this._Plugin.Entity;
-			}
-			set
-			{
-				Plugin previousValue = this._Plugin.Entity;
-				if (((previousValue != value) 
-							|| (this._Plugin.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Plugin.Entity = null;
-						previousValue.PluginData.Remove(this);
-					}
-					this._Plugin.Entity = value;
-					if ((value != null))
-					{
-						value.PluginData.Add(this);
-						this._PluginId = value.PluginId;
-					}
-					else
-					{
-						this._PluginId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Plugin");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.StateLog")]
-	public partial class StateLog : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _StateLogId;
-		
-		private global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState _State;
-		
-		private System.DateTime _DateTime;
-		
-		private System.Guid _JobId;
-		
-		private System.Nullable<System.Guid> _UserId;
-		
-		private System.Nullable<System.Guid> _SlaveId;
-		
-		private string _Exception;
-		
-		private EntityRef<Job> _Job;
-		
-		private EntityRef<Resource> _Resource;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnStateLogIdChanging(System.Guid value);
-    partial void OnStateLogIdChanged();
-    partial void OnStateChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState value);
-    partial void OnStateChanged();
-    partial void OnDateTimeChanging(System.DateTime value);
-    partial void OnDateTimeChanged();
-    partial void OnJobIdChanging(System.Guid value);
-    partial void OnJobIdChanged();
-    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
-    partial void OnUserIdChanged();
-    partial void OnSlaveIdChanging(System.Nullable<System.Guid> value);
-    partial void OnSlaveIdChanged();
-    partial void OnExceptionChanging(string value);
-    partial void OnExceptionChanged();
-    #endregion
-		
-		public StateLog()
-		{
-			this._Job = default(EntityRef<Job>);
-			this._Resource = default(EntityRef<Resource>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StateLogId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid StateLogId
-		{
-			get
-			{
-				return this._StateLogId;
-			}
-			set
-			{
-				if ((this._StateLogId != value))
-				{
-					this.OnStateLogIdChanging(value);
-					this.SendPropertyChanging();
-					this._StateLogId = value;
-					this.SendPropertyChanged("StateLogId");
-					this.OnStateLogIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="VarChar(30) NOT NULL", CanBeNull=false)]
-		public global::HeuristicLab.Services.Hive.Common.DataTransfer.JobState State
-		{
-			get
-			{
-				return this._State;
-			}
-			set
-			{
-				if ((this._State != value))
-				{
-					this.OnStateChanging(value);
-					this.SendPropertyChanging();
-					this._State = value;
-					this.SendPropertyChanged("State");
-					this.OnStateChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateTime", DbType="DateTime NOT NULL")]
-		public System.DateTime DateTime
-		{
-			get
-			{
-				return this._DateTime;
-			}
-			set
-			{
-				if ((this._DateTime != value))
-				{
-					this.OnDateTimeChanging(value);
-					this.SendPropertyChanging();
-					this._DateTime = value;
-					this.SendPropertyChanged("DateTime");
-					this.OnDateTimeChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid JobId
-		{
-			get
-			{
-				return this._JobId;
-			}
-			set
-			{
-				if ((this._JobId != value))
-				{
-					if (this._Job.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnJobIdChanging(value);
-					this.SendPropertyChanging();
-					this._JobId = value;
-					this.SendPropertyChanged("JobId");
-					this.OnJobIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> UserId
-		{
-			get
-			{
-				return this._UserId;
-			}
-			set
-			{
-				if ((this._UserId != value))
-				{
-					this.OnUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._UserId = value;
-					this.SendPropertyChanged("UserId");
-					this.OnUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveId", DbType="UniqueIdentifier")]
-		public System.Nullable<System.Guid> SlaveId
-		{
-			get
-			{
-				return this._SlaveId;
-			}
-			set
-			{
-				if ((this._SlaveId != value))
-				{
-					if (this._Resource.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnSlaveIdChanging(value);
-					this.SendPropertyChanging();
-					this._SlaveId = value;
-					this.SendPropertyChanged("SlaveId");
-					this.OnSlaveIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="VarChar(MAX)", CanBeNull=false)]
-		public string Exception
-		{
-			get
-			{
-				return this._Exception;
-			}
-			set
-			{
-				if ((this._Exception != value))
-				{
-					this.OnExceptionChanging(value);
-					this.SendPropertyChanging();
-					this._Exception = value;
-					this.SendPropertyChanged("Exception");
-					this.OnExceptionChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_StateLog", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
-		public Job Job
-		{
-			get
-			{
-				return this._Job.Entity;
-			}
-			set
-			{
-				Job previousValue = this._Job.Entity;
-				if (((previousValue != value) 
-							|| (this._Job.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Job.Entity = null;
-						previousValue.StateLogs.Remove(this);
-					}
-					this._Job.Entity = value;
-					if ((value != null))
-					{
-						value.StateLogs.Add(this);
-						this._JobId = value.JobId;
-					}
-					else
-					{
-						this._JobId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Job");
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_StateLog", Storage="_Resource", ThisKey="SlaveId", OtherKey="ResourceId", IsForeignKey=true)]
-		public Resource Resource
-		{
-			get
-			{
-				return this._Resource.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._Resource.Entity;
-				if (((previousValue != value) 
-							|| (this._Resource.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Resource.Entity = null;
-						previousValue.StateLogs.Remove(this);
-					}
-					this._Resource.Entity = value;
-					if ((value != null))
-					{
-						value.StateLogs.Add(this);
-						this._SlaveId = value.ResourceId;
-					}
-					else
-					{
-						this._SlaveId = default(Nullable<System.Guid>);
-					}
-					this.SendPropertyChanged("Resource");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HiveExperimentPermission")]
-	public partial class HiveExperimentPermission : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _HiveExperimentId;
-		
-		private System.Guid _GrantedUserId;
-		
-		private System.Guid _GrantedByUserId;
-		
-		private global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission _Permission;
-		
-		private EntityRef<HiveExperiment> _HiveExperiment;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnHiveExperimentIdChanging(System.Guid value);
-    partial void OnHiveExperimentIdChanged();
-    partial void OnGrantedUserIdChanging(System.Guid value);
-    partial void OnGrantedUserIdChanged();
-    partial void OnGrantedByUserIdChanging(System.Guid value);
-    partial void OnGrantedByUserIdChanged();
-    partial void OnPermissionChanging(global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission value);
-    partial void OnPermissionChanged();
-    #endregion
-		
-		public HiveExperimentPermission()
-		{
-			this._HiveExperiment = default(EntityRef<HiveExperiment>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiveExperimentId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid HiveExperimentId
-		{
-			get
-			{
-				return this._HiveExperimentId;
-			}
-			set
-			{
-				if ((this._HiveExperimentId != value))
-				{
-					if (this._HiveExperiment.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnHiveExperimentIdChanging(value);
-					this.SendPropertyChanging();
-					this._HiveExperimentId = value;
-					this.SendPropertyChanged("HiveExperimentId");
-					this.OnHiveExperimentIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid GrantedUserId
-		{
-			get
-			{
-				return this._GrantedUserId;
-			}
-			set
-			{
-				if ((this._GrantedUserId != value))
-				{
-					this.OnGrantedUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._GrantedUserId = value;
-					this.SendPropertyChanged("GrantedUserId");
-					this.OnGrantedUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid GrantedByUserId
-		{
-			get
-			{
-				return this._GrantedByUserId;
-			}
-			set
-			{
-				if ((this._GrantedByUserId != value))
-				{
-					this.OnGrantedByUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._GrantedByUserId = value;
-					this.SendPropertyChanged("GrantedByUserId");
-					this.OnGrantedByUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Permission", DbType="VarChar(15) NOT NULL", CanBeNull=false)]
-		public global::HeuristicLab.Services.Hive.Common.DataTransfer.Permission Permission
-		{
-			get
-			{
-				return this._Permission;
-			}
-			set
-			{
-				if ((this._Permission != value))
-				{
-					this.OnPermissionChanging(value);
-					this.SendPropertyChanging();
-					this._Permission = value;
-					this.SendPropertyChanged("Permission");
-					this.OnPermissionChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="HiveExperiment_HiveExperimentPermission", Storage="_HiveExperiment", ThisKey="HiveExperimentId", OtherKey="HiveExperimentId", IsForeignKey=true)]
-		public HiveExperiment HiveExperiment
-		{
-			get
-			{
-				return this._HiveExperiment.Entity;
-			}
-			set
-			{
-				HiveExperiment previousValue = this._HiveExperiment.Entity;
-				if (((previousValue != value) 
-							|| (this._HiveExperiment.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._HiveExperiment.Entity = null;
-						previousValue.HiveExperimentPermissions.Remove(this);
-					}
-					this._HiveExperiment.Entity = value;
-					if ((value != null))
-					{
-						value.HiveExperimentPermissions.Add(this);
-						this._HiveExperimentId = value.HiveExperimentId;
-					}
-					else
-					{
-						this._HiveExperimentId = default(System.Guid);
-					}
-					this.SendPropertyChanged("HiveExperiment");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
-	public partial class Lifecycle : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private int _LifecycleId;
-		
-		private System.DateTime _LastCleanup;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnLifecycleIdChanging(int value);
-    partial void OnLifecycleIdChanged();
-    partial void OnLastCleanupChanging(System.DateTime value);
-    partial void OnLastCleanupChanged();
-    #endregion
-		
-		public Lifecycle()
-		{
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LifecycleId", DbType="Int", IsPrimaryKey=true)]
-		public int LifecycleId
-		{
-			get
-			{
-				return this._LifecycleId;
-			}
-			set
-			{
-				if ((this._LifecycleId != value))
-				{
-					this.OnLifecycleIdChanging(value);
-					this.SendPropertyChanging();
-					this._LifecycleId = value;
-					this.SendPropertyChanged("LifecycleId");
-					this.OnLifecycleIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastCleanup", DbType="DateTime")]
-		public System.DateTime LastCleanup
-		{
-			get
-			{
-				return this._LastCleanup;
-			}
-			set
-			{
-				if ((this._LastCleanup != value))
-				{
-					this.OnLastCleanupChanging(value);
-					this.SendPropertyChanging();
-					this._LastCleanup = value;
-					this.SendPropertyChanged("LastCleanup");
-					this.OnLastCleanupChanged();
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
-	public partial class DeletedJobStatistics : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _UserId;
-		
-		private double _ExecutionTime;
-		
-		private double _ExecutionTimeFinishedJobs;
-		
-		private double _StartToEndTime;
-		
-		private System.Guid _DeletedJobStatisticsId;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnUserIdChanging(System.Guid value);
-    partial void OnUserIdChanged();
-    partial void OnExecutionTimeMsChanging(double value);
-    partial void OnExecutionTimeMsChanged();
-    partial void OnExecutionTimeMsFinishedJobsChanging(double value);
-    partial void OnExecutionTimeMsFinishedJobsChanged();
-    partial void OnStartToEndTimeMsChanging(double value);
-    partial void OnStartToEndTimeMsChanged();
-    partial void OnDeletedJobStatisticsIdChanging(System.Guid value);
-    partial void OnDeletedJobStatisticsIdChanged();
-    #endregion
-		
-		public DeletedJobStatistics()
-		{
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid UserId
-		{
-			get
-			{
-				return this._UserId;
-			}
-			set
-			{
-				if ((this._UserId != value))
-				{
-					this.OnUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._UserId = value;
-					this.SendPropertyChanged("UserId");
-					this.OnUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float NOT NULL")]
-		public double ExecutionTimeMs
-		{
-			get
-			{
-				return this._ExecutionTime;
-			}
-			set
-			{
-				if ((this._ExecutionTime != value))
-				{
-					this.OnExecutionTimeMsChanging(value);
-					this.SendPropertyChanging();
-					this._ExecutionTime = value;
-					this.SendPropertyChanged("ExecutionTimeMs");
-					this.OnExecutionTimeMsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTimeFinishedJobs", DbType="float NOT NULL")]
-		public double ExecutionTimeMsFinishedJobs
-		{
-			get
-			{
-				return this._ExecutionTimeFinishedJobs;
-			}
-			set
-			{
-				if ((this._ExecutionTimeFinishedJobs != value))
-				{
-					this.OnExecutionTimeMsFinishedJobsChanging(value);
-					this.SendPropertyChanging();
-					this._ExecutionTimeFinishedJobs = value;
-					this.SendPropertyChanged("ExecutionTimeMsFinishedJobs");
-					this.OnExecutionTimeMsFinishedJobsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartToEndTime", DbType="float NOT NULL")]
-		public double StartToEndTimeMs
-		{
-			get
-			{
-				return this._StartToEndTime;
-			}
-			set
-			{
-				if ((this._StartToEndTime != value))
-				{
-					this.OnStartToEndTimeMsChanging(value);
-					this.SendPropertyChanging();
-					this._StartToEndTime = value;
-					this.SendPropertyChanged("StartToEndTimeMs");
-					this.OnStartToEndTimeMsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DeletedJobStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid DeletedJobStatisticsId
-		{
-			get
-			{
-				return this._DeletedJobStatisticsId;
-			}
-			set
-			{
-				if ((this._DeletedJobStatisticsId != value))
-				{
-					this.OnDeletedJobStatisticsIdChanging(value);
-					this.SendPropertyChanging();
-					this._DeletedJobStatisticsId = value;
-					this.SendPropertyChanged("DeletedJobStatisticsId");
-					this.OnDeletedJobStatisticsIdChanged();
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
-	public partial class UserStatistics : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _StatisticsId;
-		
-		private System.Guid _UserId;
-		
-		private double _ExecutionTime;
-		
-		private int _CoresUsed;
-		
-		private double _ExecutionTimeFinishedJobs;
-		
-		private double _StartToEndTime;
-		
-		private EntityRef<Statistics> _Statistics;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnStatisticsIdChanging(System.Guid value);
-    partial void OnStatisticsIdChanged();
-    partial void OnUserIdChanging(System.Guid value);
-    partial void OnUserIdChanged();
-    partial void OnExecutionTimeMsChanging(double value);
-    partial void OnExecutionTimeMsChanged();
-    partial void OnUsedCoresChanging(int value);
-    partial void OnUsedCoresChanged();
-    partial void OnExecutionTimeMsFinishedJobsChanging(double value);
-    partial void OnExecutionTimeMsFinishedJobsChanged();
-    partial void OnStartToEndTimeMsChanging(double value);
-    partial void OnStartToEndTimeMsChanged();
-    #endregion
-		
-		public UserStatistics()
-		{
-			this._Statistics = default(EntityRef<Statistics>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid StatisticsId
-		{
-			get
-			{
-				return this._StatisticsId;
-			}
-			set
-			{
-				if ((this._StatisticsId != value))
-				{
-					if (this._Statistics.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnStatisticsIdChanging(value);
-					this.SendPropertyChanging();
-					this._StatisticsId = value;
-					this.SendPropertyChanged("StatisticsId");
-					this.OnStatisticsIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid UserId
-		{
-			get
-			{
-				return this._UserId;
-			}
-			set
-			{
-				if ((this._UserId != value))
-				{
-					this.OnUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._UserId = value;
-					this.SendPropertyChanged("UserId");
-					this.OnUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float NOT NULL")]
-		public double ExecutionTimeMs
-		{
-			get
-			{
-				return this._ExecutionTime;
-			}
-			set
-			{
-				if ((this._ExecutionTime != value))
-				{
-					this.OnExecutionTimeMsChanging(value);
-					this.SendPropertyChanging();
-					this._ExecutionTime = value;
-					this.SendPropertyChanged("ExecutionTimeMs");
-					this.OnExecutionTimeMsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresUsed", DbType="Int NOT NULL")]
-		public int UsedCores
-		{
-			get
-			{
-				return this._CoresUsed;
-			}
-			set
-			{
-				if ((this._CoresUsed != value))
-				{
-					this.OnUsedCoresChanging(value);
-					this.SendPropertyChanging();
-					this._CoresUsed = value;
-					this.SendPropertyChanged("UsedCores");
-					this.OnUsedCoresChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTimeFinishedJobs", DbType="float NOT NULL")]
-		public double ExecutionTimeMsFinishedJobs
-		{
-			get
-			{
-				return this._ExecutionTimeFinishedJobs;
-			}
-			set
-			{
-				if ((this._ExecutionTimeFinishedJobs != value))
-				{
-					this.OnExecutionTimeMsFinishedJobsChanging(value);
-					this.SendPropertyChanging();
-					this._ExecutionTimeFinishedJobs = value;
-					this.SendPropertyChanged("ExecutionTimeMsFinishedJobs");
-					this.OnExecutionTimeMsFinishedJobsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartToEndTime", DbType="float NOT NULL")]
-		public double StartToEndTimeMs
-		{
-			get
-			{
-				return this._StartToEndTime;
-			}
-			set
-			{
-				if ((this._StartToEndTime != value))
-				{
-					this.OnStartToEndTimeMsChanging(value);
-					this.SendPropertyChanging();
-					this._StartToEndTime = value;
-					this.SendPropertyChanged("StartToEndTimeMs");
-					this.OnStartToEndTimeMsChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_UserStatistics", Storage="_Statistics", ThisKey="StatisticsId", OtherKey="StatisticsId", IsForeignKey=true)]
-		public Statistics Statistics
-		{
-			get
-			{
-				return this._Statistics.Entity;
-			}
-			set
-			{
-				Statistics previousValue = this._Statistics.Entity;
-				if (((previousValue != value) 
-							|| (this._Statistics.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Statistics.Entity = null;
-						previousValue.UserStatistics.Remove(this);
-					}
-					this._Statistics.Entity = value;
-					if ((value != null))
-					{
-						value.UserStatistics.Add(this);
-						this._StatisticsId = value.StatisticsId;
-					}
-					else
-					{
-						this._StatisticsId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Statistics");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
-	public partial class SlaveStatistics : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _StatisticsId;
-		
-		private System.Guid _SlaveId;
-		
-		private int _Cores;
-		
-		private int _FreeCores;
-		
-		private double _CpuUtilization;
-		
-		private int _Memory;
-		
-		private int _FreeMemory;
-		
-		private EntityRef<Statistics> _Statistics;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnStatisticsIdChanging(System.Guid value);
-    partial void OnStatisticsIdChanged();
-    partial void OnSlaveIdChanging(System.Guid value);
-    partial void OnSlaveIdChanged();
-    partial void OnCoresChanging(int value);
-    partial void OnCoresChanged();
-    partial void OnFreeCoresChanging(int value);
-    partial void OnFreeCoresChanged();
-    partial void OnCpuUtilizationChanging(double value);
-    partial void OnCpuUtilizationChanged();
-    partial void OnMemoryChanging(int value);
-    partial void OnMemoryChanged();
-    partial void OnFreeMemoryChanging(int value);
-    partial void OnFreeMemoryChanged();
-    #endregion
-		
-		public SlaveStatistics()
-		{
-			this._Statistics = default(EntityRef<Statistics>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid StatisticsId
-		{
-			get
-			{
-				return this._StatisticsId;
-			}
-			set
-			{
-				if ((this._StatisticsId != value))
-				{
-					if (this._Statistics.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnStatisticsIdChanging(value);
-					this.SendPropertyChanging();
-					this._StatisticsId = value;
-					this.SendPropertyChanged("StatisticsId");
-					this.OnStatisticsIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid SlaveId
-		{
-			get
-			{
-				return this._SlaveId;
-			}
-			set
-			{
-				if ((this._SlaveId != value))
-				{
-					this.OnSlaveIdChanging(value);
-					this.SendPropertyChanging();
-					this._SlaveId = value;
-					this.SendPropertyChanged("SlaveId");
-					this.OnSlaveIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Cores", DbType="Int NOT NULL")]
-		public int Cores
-		{
-			get
-			{
-				return this._Cores;
-			}
-			set
-			{
-				if ((this._Cores != value))
-				{
-					this.OnCoresChanging(value);
-					this.SendPropertyChanging();
-					this._Cores = value;
-					this.SendPropertyChanged("Cores");
-					this.OnCoresChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeCores", DbType="Int NOT NULL")]
-		public int FreeCores
-		{
-			get
-			{
-				return this._FreeCores;
-			}
-			set
-			{
-				if ((this._FreeCores != value))
-				{
-					this.OnFreeCoresChanging(value);
-					this.SendPropertyChanging();
-					this._FreeCores = value;
-					this.SendPropertyChanged("FreeCores");
-					this.OnFreeCoresChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuUtilization", DbType="float NOT NULL")]
-		public double CpuUtilization
-		{
-			get
-			{
-				return this._CpuUtilization;
-			}
-			set
-			{
-				if ((this._CpuUtilization != value))
-				{
-					this.OnCpuUtilizationChanging(value);
-					this.SendPropertyChanging();
-					this._CpuUtilization = value;
-					this.SendPropertyChanged("CpuUtilization");
-					this.OnCpuUtilizationChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Memory", DbType="Int NOT NULL")]
-		public int Memory
-		{
-			get
-			{
-				return this._Memory;
-			}
-			set
-			{
-				if ((this._Memory != value))
-				{
-					this.OnMemoryChanging(value);
-					this.SendPropertyChanging();
-					this._Memory = value;
-					this.SendPropertyChanged("Memory");
-					this.OnMemoryChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeMemory", DbType="Int NOT NULL")]
-		public int FreeMemory
-		{
-			get
-			{
-				return this._FreeMemory;
-			}
-			set
-			{
-				if ((this._FreeMemory != value))
-				{
-					this.OnFreeMemoryChanging(value);
-					this.SendPropertyChanging();
-					this._FreeMemory = value;
-					this.SendPropertyChanged("FreeMemory");
-					this.OnFreeMemoryChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_SlaveStatistics", Storage="_Statistics", ThisKey="StatisticsId", OtherKey="StatisticsId", IsForeignKey=true)]
-		public Statistics Statistics
-		{
-			get
-			{
-				return this._Statistics.Entity;
-			}
-			set
-			{
-				Statistics previousValue = this._Statistics.Entity;
-				if (((previousValue != value) 
-							|| (this._Statistics.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Statistics.Entity = null;
-						previousValue.SlaveStatistics.Remove(this);
-					}
-					this._Statistics.Entity = value;
-					if ((value != null))
-					{
-						value.SlaveStatistics.Add(this);
-						this._StatisticsId = value.StatisticsId;
-					}
-					else
-					{
-						this._StatisticsId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Statistics");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
-	public partial class Statistics : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _StatisticsId;
-		
-		private System.DateTime _Timestamp;
-		
-		private EntitySet<UserStatistics> _UserStatistics;
-		
-		private EntitySet<SlaveStatistics> _SlaveStatistics;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnStatisticsIdChanging(System.Guid value);
-    partial void OnStatisticsIdChanged();
-    partial void OnTimestampChanging(System.DateTime value);
-    partial void OnTimestampChanged();
-    #endregion
-		
-		public Statistics()
-		{
-			this._UserStatistics = new EntitySet<UserStatistics>(new Action<UserStatistics>(this.attach_UserStatistics), new Action<UserStatistics>(this.detach_UserStatistics));
-			this._SlaveStatistics = new EntitySet<SlaveStatistics>(new Action<SlaveStatistics>(this.attach_SlaveStatistics), new Action<SlaveStatistics>(this.detach_SlaveStatistics));
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid StatisticsId
-		{
-			get
-			{
-				return this._StatisticsId;
-			}
-			set
-			{
-				if ((this._StatisticsId != value))
-				{
-					this.OnStatisticsIdChanging(value);
-					this.SendPropertyChanging();
-					this._StatisticsId = value;
-					this.SendPropertyChanged("StatisticsId");
-					this.OnStatisticsIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Timestamp")]
-		public System.DateTime Timestamp
-		{
-			get
-			{
-				return this._Timestamp;
-			}
-			set
-			{
-				if ((this._Timestamp != value))
-				{
-					this.OnTimestampChanging(value);
-					this.SendPropertyChanging();
-					this._Timestamp = value;
-					this.SendPropertyChanged("Timestamp");
-					this.OnTimestampChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_UserStatistics", Storage="_UserStatistics", ThisKey="StatisticsId", OtherKey="StatisticsId")]
-		public EntitySet<UserStatistics> UserStatistics
-		{
-			get
-			{
-				return this._UserStatistics;
-			}
-			set
-			{
-				this._UserStatistics.Assign(value);
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_SlaveStatistics", Storage="_SlaveStatistics", ThisKey="StatisticsId", OtherKey="StatisticsId")]
-		public EntitySet<SlaveStatistics> SlaveStatistics
-		{
-			get
-			{
-				return this._SlaveStatistics;
-			}
-			set
-			{
-				this._SlaveStatistics.Assign(value);
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_UserStatistics(UserStatistics entity)
-		{
-			this.SendPropertyChanging();
-			entity.Statistics = this;
-		}
-		
-		private void detach_UserStatistics(UserStatistics entity)
-		{
-			this.SendPropertyChanging();
-			entity.Statistics = null;
-		}
-		
-		private void attach_SlaveStatistics(SlaveStatistics entity)
-		{
-			this.SendPropertyChanging();
-			entity.Statistics = this;
-		}
-		
-		private void detach_SlaveStatistics(SlaveStatistics entity)
-		{
-			this.SendPropertyChanging();
-			entity.Statistics = null;
-		}
-	}
-}
-#pragma warning restore 1591
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.Designer.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.Designer.cs	(revision 6700)
+++ 	(revision )
@@ -1,46 +1,0 @@
-﻿//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.225
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace HeuristicLab.Services.Hive.DataAccess {
-    
-    
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-        
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-        
-        public static Settings Default {
-            get {
-                return defaultInstance;
-            }
-        }
-        
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
-        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=T" +
-            "rue;")]
-        public string HeuristicLab_Hive_LinqConnectionString {
-            get {
-                return ((string)(this["HeuristicLab_Hive_LinqConnectionString"]));
-            }
-        }
-        
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("00:05:00")]
-        public global::System.TimeSpan LongRunningDatabaseCommandTimeout {
-            get {
-                return ((global::System.TimeSpan)(this["LongRunningDatabaseCommandTimeout"]));
-            }
-        }
-    }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.settings
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.settings	(revision 6700)
+++ 	(revision )
@@ -1,17 +1,0 @@
-﻿<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Services.Hive.DataAccess.Properties" GeneratedClassName="Settings">
-  <Profiles />
-  <Settings>
-    <Setting Name="HeuristicLab_Hive_LinqConnectionString" Type="(Connection string)" Scope="Application">
-      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
-&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;ConnectionString&gt;Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;&lt;/ConnectionString&gt;
-  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
-&lt;/SerializableConnectionString&gt;</DesignTimeValue>
-      <Value Profile="(Default)">Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;</Value>
-    </Setting>
-    <Setting Name="LongRunningDatabaseCommandTimeout" Type="System.TimeSpan" Scope="Application">
-      <Value Profile="(Default)">00:05:00</Value>
-    </Setting>
-  </Settings>
-</SettingsFile>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/TransactionManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/TransactionManager.cs	(revision 6700)
+++ 	(revision )
@@ -1,83 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Transactions;
-using HeuristicLab.Services.Hive.Common;
-
-namespace HeuristicLab.Services.Hive.DataAccess {  
-  public class TransactionManager : ITransactionManager {    
-    public void UseTransaction(Action call, bool serializable = false, bool longRunning = false) {
-      int n = 10;
-      while (n > 0) {
-        TransactionScope transaction = CreateTransaction(serializable, longRunning);
-        try {
-          call();
-          transaction.Complete();
-          n = 0;
-        }
-        catch (System.Data.SqlClient.SqlException e) {
-          n--; // probably deadlock situation, let it roll back and repeat the transaction n times
-          LogFactory.GetLogger(typeof(TransactionManager).Namespace).Log(string.Format("Exception occured, repeating transaction {0} more times. Details: {1}", n, e.ToString()));          
-          if (n <= 0) throw;
-        }
-        finally {
-          transaction.Dispose();
-        }
-      }
-    }
-
-    public T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false) {
-      int n = 10;
-      while (n > 0) {
-        TransactionScope transaction = CreateTransaction(serializable, longRunning);
-        try {
-          T result = call();
-          transaction.Complete();
-          n = 0;
-          return result;
-        }
-        catch (System.Data.SqlClient.SqlException e) {
-          n--; // probably deadlock situation, let it roll back and repeat the transaction n times
-          LogFactory.GetLogger(typeof(TransactionManager).Namespace).Log(string.Format("Exception occured, repeating transaction {0} more times. Details: {1}", n, e.ToString()));
-          if (n <= 0) throw;
-        }
-        finally {
-          transaction.Dispose();
-        }
-      }
-      throw new Exception("This code should not be reached");
-    }
-
-    private TransactionScope CreateTransaction(bool serializable, bool longRunning) {
-      var options = new TransactionOptions();
-      if (serializable)
-        options.IsolationLevel = IsolationLevel.Serializable;
-      else
-        options.IsolationLevel = IsolationLevel.ReadUncommitted;
-
-      if (longRunning)
-        options.Timeout = Settings.Default.LongRunningDatabaseCommandTimeout;
-
-      return new TransactionScope(TransactionScopeOption.Required, options);
-    }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/app.config
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/app.config	(revision 6700)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<?xml version="1.0"?>
-<configuration>
-  <configSections>
-    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
-      <section name="HeuristicLab.Services.Hive.DataAccess.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
-    </sectionGroup>
-  </configSections>
-  <connectionStrings>
-    <add name="HeuristicLab.Services.Hive.DataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString"
-      connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;"
-      providerName="System.Data.SqlClient" />
-  </connectionStrings>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><applicationSettings>
-    <HeuristicLab.Services.Hive.DataAccess.Settings>
-      <setting name="LongRunningDatabaseCommandTimeout" serializeAs="String">
-        <value>00:05:00</value>
-      </setting>
-    </HeuristicLab.Services.Hive.DataAccess.Settings>
-  </applicationSettings>
-</configuration>
