Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs	(revision 6452)
@@ -277,5 +277,5 @@
         ServiceLocator.Instance.CallHiveService(service => {
           var appointments = service.GetScheduleForResource(resourceId);
-          ItemList<Appointment> ias = new ItemList<Appointment>();
+          ItemList<Downtime> ias = new ItemList<Downtime>();
           appointments.ForEach(a => ias.Add(a));
           scheduleView.Invoke(new Action(() => scheduleView.Content = ias));
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ScheduleView.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ScheduleView.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ScheduleView.cs	(revision 6452)
@@ -33,8 +33,8 @@
 namespace HeuristicLab.Clients.Hive.Administration.Views {
   [View("ScheduleView")]
-  [Content(typeof(IItemList<Appointment>), IsDefaultView = true)]
+  [Content(typeof(IItemList<Downtime>), IsDefaultView = true)]
   public partial class ScheduleView : ItemView {
-    public new IItemList<Appointment> Content {
-      get { return (IItemList<Appointment>)base.Content; }
+    public new IItemList<Downtime> Content {
+      get { return (IItemList<Downtime>)base.Content; }
       set { base.Content = value; }
     }
@@ -93,5 +93,5 @@
     private void UpdateCalendarFromContent() {
       offlineTimes.Clear();
-      foreach (Appointment app in Content) {
+      foreach (Downtime app in Content) {
         offlineTimes.Add(new HiveAppointment {
           AllDayEvent = app.AllDayEvent,
@@ -331,5 +331,5 @@
 
     private void btnSaveCal_Click(object sender, EventArgs e) {
-      List<Appointment> appointments = new List<Appointment>();
+      List<Downtime> appointments = new List<Downtime>();
       foreach (HiveAppointment app in offlineTimes) {
         if (app.Deleted) {
@@ -340,5 +340,5 @@
           });
         } else if (app.Changed) {
-          Appointment apdto = new Appointment {
+          Downtime apdto = new Downtime {
             AllDayEvent = app.AllDayEvent,
             EndDate = app.EndDate,
@@ -355,5 +355,5 @@
         //TODO: find a sane way to do this
         ServiceLocator.Instance.CallHiveService(service => {
-          foreach (Appointment app in appointments) {
+          foreach (Downtime app in appointments) {
             service.AddAppointment(app);
           }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs	(revision 6452)
@@ -23,6 +23,4 @@
 using System.Collections.Generic;
 using HeuristicLab.Common;
-using HeuristicLab.Hive;
-using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Clients.Hive.SlaveCore {
@@ -62,32 +60,4 @@
     public void UpdateJob(Job job) {
       CallHiveService(s => s.UpdateJob(job));
-    }
-
-    public Guid AddChildJob(Guid parentJobId, Job job, IJob jobDataObject) {
-      return CallHiveService(s => {
-        JobData jobData = new JobData();
-        IEnumerable<Type> types;
-        jobData.Data = PersistenceUtil.Serialize(jobDataObject, out types);
-        var plugins = new List<IPluginDescription>();
-        PluginUtil.CollectDeclaringPlugins(plugins, types);
-        job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, new List<Plugin>(), new List<Plugin>(), plugins);
-        return s.AddChildJob(parentJobId, job, jobData);
-      });
-    }
-
-    public IEnumerable<JobData> GetChildJobs(Guid? parentJobId) {
-      return CallHiveService(service => {
-        IEnumerable<LightweightJob> msg = service.GetLightweightChildJobs(parentJobId, false, false);
-
-        List<JobData> jobs = new List<JobData>();
-        foreach (LightweightJob ljob in msg)
-          jobs.Add(service.GetJobData(ljob.Id));
-
-        return jobs;
-      });
-    }
-
-    public void DeleteChildJobs(Guid jobId) {
-      CallHiveService(s => s.DeleteChildJobs(jobId));
     }
     #endregion
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/ExperimentManagerTests.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/ExperimentManagerTests.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/ExperimentManagerTests.cs	(revision 6452)
@@ -47,10 +47,9 @@
       rhc.HiveExperiment.HiveJobs.Add(new OptimizerHiveJob(optimizer));
       
-      HiveClient.StartExperiment((Exception ex) => TestContext.WriteLine(ex.ToString()), rhc);
+      HiveClient.StartExperiment((Exception ex) => TestContext.WriteLine(ex.ToString()), rhc, new CancellationToken());
 
       while (rhc.HiveExperiment.ExecutionState != Core.ExecutionState.Stopped) {
         Thread.Sleep(500);
       }
-
     }
 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/HeuristicLab.Clients.Hive.Tests-3.4.csproj
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/HeuristicLab.Clients.Hive.Tests-3.4.csproj	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/HeuristicLab.Clients.Hive.Tests-3.4.csproj	(revision 6452)
@@ -363,7 +363,4 @@
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup>
-    <None Include="app.config" />
-  </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 6452)
@@ -3,5 +3,5 @@
 
 namespace HeuristicLab.Clients.Hive.Tests {
-  public class MockServiceLocator {
+  public class MockServiceLocator : IServiceLocator {
     private string username;
     public string Username {
@@ -28,4 +28,17 @@
       return call(GetService());
     }
+
+    #region IServiceLocator Members
+
+    public void CallHiveService(Action<IHiveService> call) {
+      // how to do this?
+    }
+
+    public T CallHiveService<T>(Func<IHiveService, T> call) {
+      // how to do this?
+      throw new NotImplementedException();
+    }
+
+    #endregion
   }
 }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj	(revision 6452)
@@ -120,5 +120,5 @@
     <None Include="app_services.config" />
     <None Include="app.config" />
-    <None Include="ClassDiagram2.cd" />
+    <None Include="ClassDiagram.cd" />
     <None Include="HeuristicLabClientsHivePlugin.cs.frame" />
     <Compile Include="Exceptions\AddJobToHiveException.cs" />
@@ -151,5 +151,5 @@
     <Compile Include="Exceptions\ServiceClientFactoryException.cs" />
     <Compile Include="ScopeExtensions.cs" />
-    <Compile Include="ServiceClients\Appointment.cs" />
+    <Compile Include="ServiceClients\Downtime.cs" />
     <Compile Include="ServiceClients\HiveItemCollection.cs" />
     <Compile Include="ServiceClients\IHiveItem.cs" />
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs	(revision 6452)
@@ -192,4 +192,5 @@
     private Semaphore jobUploadSemaphore = new Semaphore(4, 4); // todo: take magic number into config
     private static object jobCountLocker = new object();
+    private static object pluginLocker = new object();
     private void UploadExperiment(RefreshableHiveExperiment refreshableHiveExperiment, CancellationToken cancellationToken) {
       try {
@@ -285,23 +286,23 @@
           jobCount[0]++;
         }
-        JobData jobData = null;
-        List<IPluginDescription> plugins = null;
-
-        TryAndRepeat(() => { // workaround for persistence bug (thread-safe access to bitmaps) - remove later
-          if (hiveJob.ItemJob.ComputeInParallel && (hiveJob.ItemJob.Item is Optimization.Experiment || hiveJob.ItemJob.Item is Optimization.BatchRun)) {
-            hiveJob.Job.IsParentJob = true;
-            hiveJob.Job.FinishWhenChildJobsFinished = true;
-            jobData = hiveJob.GetAsJobData(true, out plugins);
-          } else {
-            hiveJob.Job.IsParentJob = false;
-            hiveJob.Job.FinishWhenChildJobsFinished = false;
-            jobData = hiveJob.GetAsJobData(false, out plugins);
-          }
-        }, 30, "Could not serialize job");
+        JobData jobData;
+        List<IPluginDescription> plugins;
+
+        if (hiveJob.ItemJob.ComputeInParallel && (hiveJob.ItemJob.Item is Optimization.Experiment || hiveJob.ItemJob.Item is Optimization.BatchRun)) {
+          hiveJob.Job.IsParentJob = true;
+          hiveJob.Job.FinishWhenChildJobsFinished = true;
+          jobData = hiveJob.GetAsJobData(true, out plugins);
+        } else {
+          hiveJob.Job.IsParentJob = false;
+          hiveJob.Job.FinishWhenChildJobsFinished = false;
+          jobData = hiveJob.GetAsJobData(false, out plugins);
+        }
         cancellationToken.ThrowIfCancellationRequested();
 
         TryAndRepeat(() => {
           if (!cancellationToken.IsCancellationRequested) {
-            ServiceLocator.Instance.CallHiveService((s) => hiveJob.Job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, this.onlinePlugins, this.alreadyUploadedPlugins, plugins));
+            lock (pluginLocker) {
+              ServiceLocator.Instance.CallHiveService((s) => hiveJob.Job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, this.onlinePlugins, this.alreadyUploadedPlugins, plugins));
+            }
           }
         }, -1, "Failed to upload plugins");
@@ -333,5 +334,5 @@
             var arguments = (Tuple<HiveJob, HiveJob>)tuple;
             UploadJobWithChildren(progress, arguments.Item1, arguments.Item2, groups, jobCount, totalJobCount, configPluginId, hiveExperimentId, log, isPrivileged, cancellationToken);
-          }, new Tuple<HiveJob, HiveJob>(child, hiveJob ))
+          }, new Tuple<HiveJob, HiveJob>(child, hiveJob))
           .ContinueWith((x) => log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted));
         }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Appointment.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Appointment.cs	(revision 6451)
+++ 	(revision )
@@ -1,43 +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 HeuristicLab.Common;
-
-namespace HeuristicLab.Clients.Hive {
-
-  public partial class Appointment : IDeepCloneable, IContent {
-    public Appointment() { }
-
-    protected Appointment(Appointment original, Cloner cloner)
-      : base(original, cloner) {
-      this.AllDayEvent = original.AllDayEvent;
-      this.EndDate = original.EndDate;
-      this.Recurring = original.Recurring;
-      this.RecurringId = original.RecurringId;
-      this.ResourceId = original.ResourceId;
-      this.StartDate = original.StartDate;
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Appointment(this, cloner);
-    }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Downtime.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Downtime.cs	(revision 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Downtime.cs	(revision 6452)
@@ -0,0 +1,43 @@
+﻿#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 HeuristicLab.Common;
+
+namespace HeuristicLab.Clients.Hive {
+
+  public partial class Downtime : IDeepCloneable, IContent {
+    public Downtime() { }
+
+    protected Downtime(Downtime original, Cloner cloner)
+      : base(original, cloner) {
+      this.AllDayEvent = original.AllDayEvent;
+      this.EndDate = original.EndDate;
+      this.Recurring = original.Recurring;
+      this.RecurringId = original.RecurringId;
+      this.ResourceId = original.ResourceId;
+      this.StartDate = original.StartDate;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Downtime(this, cloner);
+    }
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs	(revision 6452)
@@ -82,5 +82,5 @@
   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.StateLog))]
   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]
-  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Appointment))]
+  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))]
   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))]
   public partial class HiveItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
@@ -938,5 +938,5 @@
       "nsfer")]
   [System.SerializableAttribute()]
-  public partial class Appointment : HeuristicLab.Clients.Hive.HiveItem {
+  public partial class Downtime : HeuristicLab.Clients.Hive.HiveItem {
 
     [System.Runtime.Serialization.OptionalFieldAttribute()]
@@ -1506,5 +1506,5 @@
 
     [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AddAppointment", ReplyAction = "http://tempuri.org/IHiveService/AddAppointmentResponse")]
-    System.Guid AddAppointment(HeuristicLab.Clients.Hive.Appointment appointment);
+    System.Guid AddAppointment(HeuristicLab.Clients.Hive.Downtime appointment);
 
     [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/DeleteAppointment", ReplyAction = "http://tempuri.org/IHiveService/DeleteAppointmentResponse")]
@@ -1512,8 +1512,8 @@
 
     [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/UpdateAppointment", ReplyAction = "http://tempuri.org/IHiveService/UpdateAppointmentResponse")]
-    void UpdateAppointment(HeuristicLab.Clients.Hive.Appointment appointment);
+    void UpdateAppointment(HeuristicLab.Clients.Hive.Downtime appointment);
 
     [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetScheduleForResource", ReplyAction = "http://tempuri.org/IHiveService/GetScheduleForResourceResponse")]
-    System.Collections.Generic.List<HeuristicLab.Clients.Hive.Appointment> GetScheduleForResource(System.Guid resourceId);
+    System.Collections.Generic.List<HeuristicLab.Clients.Hive.Downtime> GetScheduleForResource(System.Guid resourceId);
 
     [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AddJob", ReplyAction = "http://tempuri.org/IHiveService/AddJobResponse")]
@@ -1694,5 +1694,5 @@
     }
 
-    public System.Guid AddAppointment(HeuristicLab.Clients.Hive.Appointment appointment) {
+    public System.Guid AddAppointment(HeuristicLab.Clients.Hive.Downtime appointment) {
       return base.Channel.AddAppointment(appointment);
     }
@@ -1702,9 +1702,9 @@
     }
 
-    public void UpdateAppointment(HeuristicLab.Clients.Hive.Appointment appointment) {
+    public void UpdateAppointment(HeuristicLab.Clients.Hive.Downtime appointment) {
       base.Channel.UpdateAppointment(appointment);
     }
 
-    public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Appointment> GetScheduleForResource(System.Guid resourceId) {
+    public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Downtime> GetScheduleForResource(System.Guid resourceId) {
       return base.Channel.GetScheduleForResource(resourceId);
     }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Util/PluginUtil.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Util/PluginUtil.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Util/PluginUtil.cs	(revision 6452)
@@ -30,5 +30,4 @@
 namespace HeuristicLab.Clients.Hive {
   public static class PluginUtil {
-    private static object locker = new object();
 
     /// <summary>
@@ -41,39 +40,37 @@
     /// <returns></returns>
     public static List<Guid> GetPluginDependencies(IHiveService service, List<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins) {
-      lock (locker) {
-        var pluginIds = new List<Guid>();
-        Dictionary<IPluginDescription, byte[]> checksumsNeededPlugins = CalcChecksumsForPlugins(neededPlugins);
+      var pluginIds = new List<Guid>();
+      Dictionary<IPluginDescription, byte[]> checksumsNeededPlugins = CalcChecksumsForPlugins(neededPlugins);
 
-        foreach (var neededPlugin in checksumsNeededPlugins) {
-          Plugin foundPlugin = alreadyUploadedPlugins.FirstOrDefault(p => p.Hash.SequenceEqual(neededPlugin.Value));
+      foreach (var neededPlugin in checksumsNeededPlugins) {
+        Plugin foundPlugin = alreadyUploadedPlugins.FirstOrDefault(p => p.Hash.SequenceEqual(neededPlugin.Value));
+        if (foundPlugin == null) {
+          foundPlugin = onlinePlugins.FirstOrDefault(p => {
+            if (p.Hash != null) {
+              return p.Hash.SequenceEqual(neededPlugin.Value);
+            } else {
+              return false;
+            }
+          });
+
           if (foundPlugin == null) {
-            foundPlugin = onlinePlugins.FirstOrDefault(p => {
-              if (p.Hash != null) {
-                return p.Hash.SequenceEqual(neededPlugin.Value);
-              } else {
-                return false;
-              }
-            });
-
-            if (foundPlugin == null) {
-              Plugin p = CreatePlugin(neededPlugin.Key, neededPlugin.Value);
-              List<PluginData> pd = CreatePluginDatas(neededPlugin.Key);
-              try {
-                p.Id = service.AddPlugin(p, pd);
-                alreadyUploadedPlugins.Add(p);
-                pluginIds.Add(p.Id);
-              }
-              catch (FaultException<PluginAlreadyExistsFault> fault) {
-                onlinePlugins.Add(service.GetPlugin(fault.Detail.Id));
-              }
-            } else {
-              pluginIds.Add(foundPlugin.Id);
+            Plugin p = CreatePlugin(neededPlugin.Key, neededPlugin.Value);
+            List<PluginData> pd = CreatePluginDatas(neededPlugin.Key);
+            try {
+              p.Id = service.AddPlugin(p, pd);
+              alreadyUploadedPlugins.Add(p);
+              pluginIds.Add(p.Id);
+            }
+            catch (FaultException<PluginAlreadyExistsFault> fault) {
+              onlinePlugins.Add(service.GetPlugin(fault.Detail.Id));
             }
           } else {
             pluginIds.Add(foundPlugin.Id);
           }
+        } else {
+          pluginIds.Add(foundPlugin.Id);
         }
-        return pluginIds;
       }
+      return pluginIds;
     }
 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs	(revision 6452)
@@ -94,6 +94,6 @@
     #region constructors and cloning
     public HiveEngine() {
-      ResourceNames = "HEAL";
-      Priority = 0;
+      this.ResourceNames = "HEAL";
+      this.Priority = 0;
       this.log = new ThreadSafeLog(this.log);
     }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Appointment.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Appointment.cs	(revision 6451)
+++ 	(revision )
@@ -1,41 +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.Runtime.Serialization;
-
-namespace HeuristicLab.Services.Hive.Common.DataTransfer {
-  [DataContract]
-  public class Appointment : HiveItem {
-    [DataMember]
-    public DateTime StartDate { get; set; }
-    [DataMember]
-    public DateTime EndDate { get; set; }
-    [DataMember]
-    public bool AllDayEvent { get; set; }
-    [DataMember]
-    public bool Recurring { get; set; }
-    [DataMember]
-    public Guid RecurringId { get; set; }
-    [DataMember]
-    public Guid ResourceId { get; set; }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/CalendarState.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/CalendarState.cs	(revision 6451)
+++ 	(revision )
@@ -1,31 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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
-
-
-namespace HeuristicLab.Services.Hive.Common.DataTransfer {
-  public enum CalendarState {
-    Fetch,
-    ForceFetch,
-    Fetching,
-    Fetched,
-    NotAllowedToFetch
-  };
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Downtime.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Downtime.cs	(revision 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Downtime.cs	(revision 6452)
@@ -0,0 +1,41 @@
+﻿#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.Runtime.Serialization;
+
+namespace HeuristicLab.Services.Hive.Common.DataTransfer {
+  [DataContract]
+  public class Downtime : HiveItem {
+    [DataMember]
+    public DateTime StartDate { get; set; }
+    [DataMember]
+    public DateTime EndDate { get; set; }
+    [DataMember]
+    public bool AllDayEvent { get; set; }
+    [DataMember]
+    public bool Recurring { get; set; }
+    [DataMember]
+    public Guid RecurringId { get; set; }
+    [DataMember]
+    public Guid ResourceId { get; set; }
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Project.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Project.cs	(revision 6451)
+++ 	(revision )
@@ -1,37 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Runtime.Serialization;
-using HeuristicLab.Common;
-
-namespace HeuristicLab.Services.Hive.Common.DataTransfer {
-  [DataContract]
-  [Serializable]
-  public class Project : NamedHiveItem {
-
-    public Project() { }
-    protected Project(Project original, Cloner cloner) : base(original, cloner) { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Project(this, cloner);
-    }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/SlaveConfig.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/SlaveConfig.cs	(revision 6451)
+++ 	(revision )
@@ -1,44 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Runtime.Serialization;
-using HeuristicLab.Common;
-
-namespace HeuristicLab.Services.Hive.Common.DataTransfer {
-  [DataContract]
-  [Serializable]
-  public class SlaveConfig : HiveItem {
-    [DataMember]
-    public String UpDownTimeCalendar { get; set; }
-    [DataMember]
-    public int? HeartBeatIntervall { get; set; }
-
-    public SlaveConfig() { }
-    protected SlaveConfig(SlaveConfig original, Cloner cloner) : base(original, cloner) {
-      this.UpDownTimeCalendar = original.UpDownTimeCalendar;
-      this.HeartBeatIntervall = original.HeartBeatIntervall;
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new SlaveConfig(this, cloner);
-    }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/UpTimeStatistics.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/UpTimeStatistics.cs	(revision 6451)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Runtime.Serialization;
-using HeuristicLab.Common;
-
-namespace HeuristicLab.Services.Hive.Common.DataTransfer {
-  [DataContract]
-  public class UpTimeStatistics : HiveItem {
-    [DataMember]
-    public Guid SlaveId { get; set; }
-    [DataMember]
-    public DateTime Login { get; set; }
-    [DataMember]
-    public DateTime Logout { get; set; }
-
-    public UpTimeStatistics() { }
-    protected UpTimeStatistics(UpTimeStatistics original, Cloner cloner) : base(original, cloner) {
-      this.SlaveId = original.SlaveId;
-      this.Login = original.Login;
-      this.Logout = original.Logout;
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new UpTimeStatistics(this, cloner);
-    }
-  }
-}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/HeuristicLab.Services.Hive.Common-3.4.csproj
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/HeuristicLab.Services.Hive.Common-3.4.csproj	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/HeuristicLab.Services.Hive.Common-3.4.csproj	(revision 6452)
@@ -94,11 +94,17 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="ApplicationConstants.cs" />
     <Compile Include="DataTransfer\SlaveStatistics.cs" />
     <Compile Include="DataTransfer\Statistics.cs" />
     <Compile Include="DataTransfer\UserStatistics.cs" />
+    <Compile Include="ITransactionManager.cs" />
     <Compile Include="ServiceFaults\PluginAlreadyExistsFault.cs" />
+    <Compile Include="Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+    <None Include="app.config" />
     <None Include="HeuristicLabServicesHiveCommonPlugin.cs.frame" />
-    <Compile Include="DataTransfer\Appointment.cs" />
+    <Compile Include="DataTransfer\Downtime.cs" />
     <Compile Include="DataTransfer\Command.cs" />
     <Compile Include="DataTransfer\HiveExperimentPermission.cs" />
@@ -125,4 +131,8 @@
     <None Include="Properties\AssemblyInfo.cs.frame" />
     <Compile Include="ServiceContracts\IHiveService.cs" />
+    <None Include="Settings.settings">
+      <Generator>PublicSettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
   </ItemGroup>
   <ItemGroup>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ITransactionManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ITransactionManager.cs	(revision 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ITransactionManager.cs	(revision 6452)
@@ -0,0 +1,29 @@
+﻿#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 {
+  public interface ITransactionManager {
+    void UseTransaction(Action call, bool serializable = false, bool longRunning = false);
+    T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false);
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 6452)
@@ -127,4 +127,6 @@
     Plugin GetPlugin(Guid pluginId);
     [OperationContract]
+    Plugin GetPluginByHash(byte[] hash);
+    [OperationContract]
     [FaultContract(typeof(PluginAlreadyExistsFault))]
     Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
@@ -133,4 +135,6 @@
     [OperationContract]
     IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
+    [OperationContract]
+    void DeletePlugin(Guid pluginId);
     #endregion
 
@@ -182,16 +186,16 @@
     #endregion
 
-    #region Appointment Methods
-    [OperationContract]
-    Guid AddAppointment(Appointment appointment);
-
-    [OperationContract]
-    void DeleteAppointment(Guid appointmentId);
-
-    [OperationContract]
-    void UpdateAppointment(Appointment appointment);
-
-    [OperationContract]
-    IEnumerable<Appointment> GetScheduleForResource(Guid resourceId);
+    #region Downtime Methods
+    [OperationContract]
+    Guid AddDowntime(Downtime downtime);
+
+    [OperationContract]
+    void DeleteDowntime(Guid downtimeId);
+
+    [OperationContract]
+    void UpdateDowntime(Downtime downtime);
+
+    [OperationContract]
+    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
     #endregion
   }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/Settings.Designer.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/Settings.Designer.cs	(revision 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/Settings.Designer.cs	(revision 6452)
@@ -0,0 +1,53 @@
+﻿//------------------------------------------------------------------------------
+// <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.Common {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+    public 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.DefaultSettingValueAttribute("00:01:00")]
+        public global::System.TimeSpan SlaveHeartbeatTimeout {
+            get {
+                return ((global::System.TimeSpan)(this["SlaveHeartbeatTimeout"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("00:05:30")]
+        public global::System.TimeSpan CalculatingJobHeartbeatTimeout {
+            get {
+                return ((global::System.TimeSpan)(this["CalculatingJobHeartbeatTimeout"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("00:05:30")]
+        public global::System.TimeSpan TransferringJobHeartbeatTimeout {
+            get {
+                return ((global::System.TimeSpan)(this["TransferringJobHeartbeatTimeout"]));
+            }
+        }
+    }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/Settings.settings
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/Settings.settings	(revision 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/Settings.settings	(revision 6452)
@@ -0,0 +1,15 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Services.Hive.Common" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="SlaveHeartbeatTimeout" Type="System.TimeSpan" Scope="Application">
+      <Value Profile="(Default)">00:01:00</Value>
+    </Setting>
+    <Setting Name="CalculatingJobHeartbeatTimeout" Type="System.TimeSpan" Scope="Application">
+      <Value Profile="(Default)">00:05:30</Value>
+    </Setting>
+    <Setting Name="TransferringJobHeartbeatTimeout" Type="System.TimeSpan" Scope="Application">
+      <Value Profile="(Default)">00:05:30</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs	(revision 6452)
@@ -113,17 +113,17 @@
     #endregion
 
-    #region Appointment
-    public static DT.Appointment ToDto(UptimeCalendar source) {
-      if (source == null) return null;
-      return new DT.Appointment { Id = source.UptimeCalendarId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
-    }
-    public static UptimeCalendar ToEntity(DT.Appointment source) {
-      if (source == null) return null;
-      var entity = new UptimeCalendar(); ToEntity(source, entity);
-      return entity;
-    }
-    public static void ToEntity(DT.Appointment source, UptimeCalendar target) {
-      if ((source != null) && (target != null)) {
-        target.UptimeCalendarId = 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;
+    #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;
       }
     }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj	(revision 6452)
@@ -109,5 +109,5 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <None Include="Properties\AssemblyInfo.cs.frame" />
-    <Compile Include="Properties\Settings.Designer.cs">
+    <Compile Include="Settings.Designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
@@ -130,5 +130,5 @@
       <SubType>Designer</SubType>
     </None>
-    <None Include="Properties\Settings.settings">
+    <None Include="Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs	(revision 6452)
@@ -24,7 +24,5 @@
 using System.Linq;
 using System.Linq.Expressions;
-using HeuristicLab.Services.Hive.Common;
 using HeuristicLab.Services.Hive.Common.DataTransfer;
-using HeuristicLab.Services.Hive.DataAccess.Properties;
 using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
 
@@ -33,5 +31,5 @@
     public static HiveDataContext CreateContext(bool longRunning = false) {
       var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
-      if (longRunning) context.CommandTimeout = (int)ApplicationConstants.LongRunningDatabaseCommandTimeout.TotalSeconds;      
+      if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;      
       return context;
     }
@@ -109,5 +107,5 @@
                            where child.ParentJobId == ar.Job.JobId
                            select child).Count() > 0
-                    orderby ar.Job.Priority, db.Random() descending
+                    orderby ar.Job.Priority descending, db.Random()
                     select Convert.ToDto(ar.Job);
         return count == 0 ? query.ToArray() : query.Take(count).ToArray();
@@ -127,5 +125,5 @@
                        && ar.Job.CoresNeeded <= slave.FreeCores
                        && ar.Job.MemoryNeeded <= slave.FreeMemory
-                    orderby ar.Job.Priority, db.Random() descending // take random job to avoid the race condition that occurs when this method is called concurrently (the same job would be returned)
+                    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();
@@ -634,39 +632,39 @@
     #endregion
 
-    #region Appointment Methods
-    public Appointment GetAppointment(Guid id) {
-      using (var db = CreateContext()) {
-        return Convert.ToDto(db.UptimeCalendars.SingleOrDefault(x => x.UptimeCalendarId == id));
-      }
-    }
-
-    public IEnumerable<Appointment> GetAppointments(Expression<Func<UptimeCalendar, bool>> predicate) {
-      using (var db = CreateContext()) {
-        return db.UptimeCalendars.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
-      }
-    }
-
-    public Guid AddAppointment(Appointment dto) {
-      using (var db = CreateContext()) {
-        var entity = Convert.ToEntity(dto);
-        db.UptimeCalendars.InsertOnSubmit(entity);
-        db.SubmitChanges();
-        return entity.UptimeCalendarId;
-      }
-    }
-
-    public void UpdateAppointment(Appointment dto) {
-      using (var db = CreateContext()) {
-        var entity = db.UptimeCalendars.FirstOrDefault(x => x.UptimeCalendarId == dto.Id);
-        if (entity == null) db.UptimeCalendars.InsertOnSubmit(Convert.ToEntity(dto));
-        else Convert.ToEntity(dto, entity);
-        db.SubmitChanges();
-      }
-    }
-
-    public void DeleteAppointment(Guid id) {
-      using (var db = CreateContext()) {
-        var entity = db.UptimeCalendars.FirstOrDefault(x => x.UptimeCalendarId == id);
-        if (entity != null) db.UptimeCalendars.DeleteOnSubmit(entity);
+    #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();
       }
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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml	(revision 6452)
@@ -1,3 +1,4 @@
 ﻿<?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.Properties.Settings" SettingsPropertyName="HeuristicLab_Hive_LinqConnectionString" Provider="System.Data.SqlClient" />
   <Table Name="dbo.AssignedResources" Member="AssignedResources">
     <Type Name="AssignedResource">
@@ -38,5 +39,5 @@
       <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_UptimeCalendar" Member="UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeCalendar" />
+      <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" />
@@ -82,7 +83,7 @@
     </Type>
   </Table>
-  <Table Name="dbo.UptimeCalendar" Member="UptimeCalendars">
-    <Type Name="UptimeCalendar">
-      <Column Name="UptimeCalendarId" Type="System.Guid" DbType="UniqueIdentifier" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+  <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" />
@@ -91,5 +92,5 @@
       <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
       <Column Name="RecurringId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
-      <Association Name="Resource_UptimeCalendar" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
     </Type>
   </Table>
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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout	(revision 6452)
@@ -34,5 +34,5 @@
     </classShape>
     <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="13.5, 2.5, 2, 2.1554996744791666">
-      <DataClassMoniker Name="/HiveDataContext/UptimeCalendar" />
+      <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" />
@@ -69,5 +69,5 @@
       </nodes>
     </inheritanceConnector>
-    <associationConnector edgePoints="[(11.9843735 : 2.57859537760417); (11.9843735 : 4.69314697265625); (10.875 : 4.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(12.25 : 2.57859537760417); (12.25 : 4.69314697265625); (10.875 : 4.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
       <nodes>
@@ -97,11 +97,4 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.54212367513021); (13.5 : 3.54212367513021)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" />
-      </nodes>
-    </associationConnector>
     <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
       <DataClassMoniker Name="/HiveDataContext/JobData" />
@@ -228,4 +221,11 @@
       </nodes>
     </associationConnector>
+    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.64829952604167); (13.5 : 3.64829952604167)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs	(revision 6452)
@@ -12,13 +12,8 @@
 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;
+  using System;
+  using System.ComponentModel;
+  using System.Data.Linq;
+  using System.Data.Linq.Mapping;
 	
 	
@@ -46,7 +41,7 @@
     partial void UpdateJob(Job instance);
     partial void DeleteJob(Job instance);
-    partial void InsertUptimeCalendar(UptimeCalendar instance);
-    partial void UpdateUptimeCalendar(UptimeCalendar instance);
-    partial void DeleteUptimeCalendar(UptimeCalendar 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);
@@ -81,4 +76,10 @@
     #endregion
 		
+		public HiveDataContext() : 
+				base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)
+		{
+			OnCreated();
+		}
+		
 		public HiveDataContext(string connection) : 
 				base(connection, mappingSource)
@@ -145,9 +146,9 @@
 		}
 		
-		public System.Data.Linq.Table<UptimeCalendar> UptimeCalendars
-		{
-			get
-			{
-				return this.GetTable<UptimeCalendar>();
+		public System.Data.Linq.Table<Downtime> Downtimes
+		{
+			get
+			{
+				return this.GetTable<Downtime>();
 			}
 		}
@@ -877,5 +878,5 @@
 		private EntitySet<Resource> _ChildResources;
 		
-		private EntitySet<UptimeCalendar> _UptimeCalendars;
+		private EntitySet<Downtime> _UptimeCalendars;
 		
 		private EntitySet<StateLog> _StateLogs;
@@ -901,5 +902,5 @@
 			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<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
+			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>);
@@ -1017,6 +1018,6 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
-		public EntitySet<UptimeCalendar> UptimeCalendars
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<Downtime> Downtimes
 		{
 			get
@@ -1121,5 +1122,5 @@
 		}
 		
-		private void attach_UptimeCalendars(UptimeCalendar entity)
+		private void attach_UptimeCalendars(Downtime entity)
 		{
 			this.SendPropertyChanging();
@@ -1127,5 +1128,5 @@
 		}
 		
-		private void detach_UptimeCalendars(UptimeCalendar entity)
+		private void detach_UptimeCalendars(Downtime entity)
 		{
 			this.SendPropertyChanging();
@@ -2040,6 +2041,6 @@
 	}
 	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UptimeCalendar")]
-	public partial class UptimeCalendar : INotifyPropertyChanging, INotifyPropertyChanged
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Downtime")]
+	public partial class Downtime : INotifyPropertyChanging, INotifyPropertyChanged
 	{
 		
@@ -2066,6 +2067,6 @@
     partial void OnValidate(System.Data.Linq.ChangeAction action);
     partial void OnCreated();
-    partial void OnUptimeCalendarIdChanging(System.Guid value);
-    partial void OnUptimeCalendarIdChanged();
+    partial void OnDowntimeIdChanging(System.Guid value);
+    partial void OnDowntimeIdChanged();
     partial void OnResourceIdChanging(System.Guid value);
     partial void OnResourceIdChanged();
@@ -2082,5 +2083,5 @@
     #endregion
 		
-		public UptimeCalendar()
+		public Downtime()
 		{
 			this._Resource = default(EntityRef<Resource>);
@@ -2089,5 +2090,5 @@
 		
 		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier", IsPrimaryKey=true, IsDbGenerated=true)]
-		public System.Guid UptimeCalendarId
+		public System.Guid DowntimeId
 		{
 			get
@@ -2099,9 +2100,9 @@
 				if ((this._UptimeCalendarId != value))
 				{
-					this.OnUptimeCalendarIdChanging(value);
+					this.OnDowntimeIdChanging(value);
 					this.SendPropertyChanging();
 					this._UptimeCalendarId = value;
-					this.SendPropertyChanged("UptimeCalendarId");
-					this.OnUptimeCalendarIdChanged();
+					this.SendPropertyChanged("DowntimeId");
+					this.OnDowntimeIdChanged();
 				}
 			}
@@ -2232,5 +2233,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
 		public Resource Resource
 		{
@@ -2249,10 +2250,10 @@
 					{
 						this._Resource.Entity = null;
-						previousValue.UptimeCalendars.Remove(this);
+						previousValue.Downtimes.Remove(this);
 					}
 					this._Resource.Entity = value;
 					if ((value != null))
 					{
-						value.UptimeCalendars.Add(this);
+						value.Downtimes.Add(this);
 						this._ResourceId = value.ResourceId;
 					}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs	(revision 6452)
@@ -129,10 +129,10 @@
     #endregion
 
-    #region Appointment Methods
-    DT.Appointment GetAppointment(Guid id);
-    IEnumerable<DT.Appointment> GetAppointments(Expression<Func<UptimeCalendar, bool>> predicate);
-    Guid AddAppointment(DT.Appointment dto);
-    void UpdateAppointment(DT.Appointment dto);
-    void DeleteAppointment(Guid id);
+    #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
 
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 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.Designer.cs	(revision 6452)
@@ -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.4/Settings.settings
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.settings	(revision 6452)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Settings.settings	(revision 6452)
@@ -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.4/Tools/Prepare Hive Database.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/Prepare Hive Database.sql	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/Prepare Hive Database.sql	(revision 6452)
@@ -73,6 +73,6 @@
 ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (NEWSEQUENTIALID()) FOR ResourceId;
 
-ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId ADD ROWGUIDCOL;
-ALTER TABLE dbo.UptimeCalendar WITH NOCHECK ADD CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId] DEFAULT (NEWSEQUENTIALID()) FOR UptimeCalendarId;
+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;
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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/TransactionManager.cs	(revision 6452)
@@ -24,7 +24,7 @@
 using HeuristicLab.Services.Hive.Common;
 
-namespace HeuristicLab.Services.Hive.DataAccess {
-  public static class TransactionManager {
-    public static void UseTransaction(Action call, bool serializable = false, bool longRunning = false) {
+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) {
@@ -46,5 +46,5 @@
     }
 
-    public static T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false) {
+    public T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false) {
       int n = 10;
       while (n > 0) {
@@ -68,5 +68,5 @@
     }
 
-    private static TransactionScope CreateTransaction(bool serializable, bool longRunning) {
+    private TransactionScope CreateTransaction(bool serializable, bool longRunning) {
       var options = new TransactionOptions();
       if (serializable)
@@ -76,5 +76,5 @@
 
       if (longRunning)
-        options.Timeout = ApplicationConstants.LongRunningDatabaseCommandTimeout;
+        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 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/app.config	(revision 6452)
@@ -2,7 +2,19 @@
 <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"/>
+    <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></configuration>
+<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.Tests/DaoTests.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs	(revision 6452)
@@ -70,4 +70,5 @@
       plugin1.UserId = Guid.Empty;
       plugin1.DateCreated = DateTime.Now;
+      plugin1.Hash = new byte[] { 1, 2, 3 };
 
       DT.PluginData pluginData1 = new DT.PluginData();
@@ -135,4 +136,7 @@
       Assert.AreEqual(null, dao.GetJobData(job1.Id));
       Assert.AreEqual(null, dao.GetHiveExperiment(he.Id));
+
+      dao.DeletePlugin(plugin1.Id);
+      Assert.AreEqual(null, dao.GetPlugin(plugin1.Id));
     }
 
@@ -177,4 +181,5 @@
       plugin1.Version = new Version("1.0.0.0");
       plugin1.UserId = Guid.Empty;
+      plugin1.Hash = new byte[] { 1, 2, 3 };
 
       plugin1.Id = dao.AddPlugin(plugin1);
@@ -186,4 +191,5 @@
       Assert.AreEqual(plugin1.UserId, plugin1loaded.UserId);
       Assert.AreEqual(plugin1.DateCreated.ToString(), plugin1loaded.DateCreated.ToString());
+      Assert.IsTrue(plugin1.Hash.SequenceEqual(plugin1loaded.Hash));
 
       DT.PluginData pluginData1 = new DT.PluginData();
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs	(revision 6452)
@@ -20,5 +20,4 @@
 #endregion
 
-
 namespace HeuristicLab.Services.Hive.Tests.Mocks {
   public class MockLifecycleManager : ILifecycleManager {
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 6452)
@@ -44,15 +44,13 @@
 
     public ILifecycleManager LifecycleManager {
-      get {
-        return defaultServiceLocator.LifecycleManager;
-      }
+      get { return defaultServiceLocator.LifecycleManager; }
+    }
+    public ITransactionManager TransactionManager {
+      get { return defaultServiceLocator.TransactionManager; }
     }
 
     public HeartbeatManager HeartbeatManager {
-      get {
-        return defaultServiceLocator.HeartbeatManager;
-      }
+      get { return defaultServiceLocator.HeartbeatManager; }
     }
-
   }
 }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs	(revision 6452)
@@ -66,4 +66,9 @@
       };
 
+      // delete plugin first (otherwise the system would not allow it because of the same hash code
+      var hash = new byte[] { 1, 2, 3 };
+      var p = service.GetPluginByHash(hash);
+      if (p != null) service.DeletePlugin(p.Id);
+
       // create plugin
       DT.Plugin plugin1 = new DT.Plugin();
@@ -72,5 +77,6 @@
       plugin1.UserId = Guid.Empty;
       plugin1.DateCreated = DateTime.Now;
-
+      plugin1.Hash = hash;
+      
       DT.PluginData pluginData1 = new DT.PluginData();
       pluginData1.FileName = "Tests.MyPlugin-1.0.dll";
@@ -167,6 +173,6 @@
       Assert.AreEqual(job.Id, actions[0].JobId);
 
-      // create appointment which should make slave unavailable for calculation
-      Guid appointmentId = service.AddAppointment(new Appointment { ResourceId = slave.Id, StartDate = DateTime.Now - TimeSpan.FromMinutes(1), EndDate = DateTime.Now + TimeSpan.FromMinutes(1), Recurring = false });
+      // create downtime which should make slave unavailable for calculation
+      Guid downtimeId = service.AddDowntime(new Downtime { ResourceId = slave.Id, StartDate = DateTime.Now - TimeSpan.FromMinutes(1), EndDate = DateTime.Now + TimeSpan.FromMinutes(1), Recurring = false });
 
       progress.Clear();
@@ -177,5 +183,5 @@
       Assert.AreEqual(Guid.Empty, actions[0].JobId);
 
-      service.DeleteAppointment(appointmentId);
+      service.DeleteDowntime(downtimeId);
 
       // delete
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config	(revision 6452)
@@ -2,4 +2,37 @@
 <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" />
+      <section name="HeuristicLab.Services.Hive.Common.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+    </sectionGroup>
+  </configSections>
+
+  <applicationSettings>
+    <HeuristicLab.Services.Hive.DataAccess.Settings>
+      <!-- Timeout for long running database command (storing or loading jobData) -->
+      <setting name="LongRunningDatabaseCommandTimeout" serializeAs="String">
+        <value>00:05:33</value>
+      </setting>
+    </HeuristicLab.Services.Hive.DataAccess.Settings>
+    
+    <HeuristicLab.Services.Hive.Common.Settings>
+      <!-- If a slave does not send a heartbeat for this time, it is set offline which means all of its jobs are rescheduled -->
+      <setting name="SlaveHeartbeatTimeout" serializeAs="String">
+        <value>00:01:00</value>
+      </setting>
+
+      <!-- When a job is in state `Calculating` this is the maximum time it does not have to send heartbeats, otherwise its rescheduled -->
+      <setting name="CalculatingJobHeartbeatTimeout" serializeAs="String">
+        <value>00:05:30</value>
+      </setting>
+
+      <!-- When a job is in state `Transferring` this is the maximum time it does not have to send heartbeats, otherwise its rescheduled --> 
+      <setting name="TransferringJobHeartbeatTimeout" serializeAs="String">
+        <value>00:05:30</value>
+      </setting>
+    </HeuristicLab.Services.Hive.Common.Settings>
+  </applicationSettings>
+  
   <connectionStrings>
     <add name="HeuristicLab.Authentication" connectionString="data source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication"/>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs	(revision 6452)
@@ -142,6 +142,6 @@
 
     private bool SlaveIsAllowedToCalculate(Guid slaveId) {
-      // appointment==doNotCompute! the slave may only calculate if there is no appointment right now. this needs to be checked for every parent resource also
-      return dao.GetParentResources(slaveId).All(r => dao.GetAppointments(x => x.ResourceId == r.Id && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0);
+      // the slave may only calculate if there is no downtime right now. this needs to be checked for every parent resource also
+      return dao.GetParentResources(slaveId).All(r => dao.GetDowntimes(x => x.ResourceId == r.Id && (DateTime.Now >= x.StartDate) && (DateTime.Now <= x.EndDate)).Count() == 0);
     }
   }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 6452)
@@ -27,5 +27,4 @@
 using HeuristicLab.Services.Hive.Common.DataTransfer;
 using HeuristicLab.Services.Hive.Common.ServiceContracts;
-using DA = HeuristicLab.Services.Hive.DataAccess;
 
 namespace HeuristicLab.Services.Hive {
@@ -45,4 +44,7 @@
     private IAuthorizationManager author {
       get { return ServiceLocator.Instance.AuthorizationManager; }
+    }  
+    private ITransactionManager trans {
+      get { return ServiceLocator.Instance.TransactionManager; }
     }
     private ILifecycleManager lifecycleManager {
@@ -56,5 +58,5 @@
     public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> resourceIds) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         job.Id = dao.AddJob(job);
         jobData.JobId = job.Id;
@@ -71,5 +73,5 @@
     public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         job.ParentJobId = parentJobId;
         return AddJob(job, jobData, dao.GetAssignedResources(parentJobId).Select(x => x.Id));
@@ -109,5 +111,5 @@
     public void UpdateJob(Job job) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.UpdateJob(job);
       });
@@ -116,5 +118,5 @@
     public void UpdateJobData(Job job, JobData jobData) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      //DA.TransactionManager.UseTransaction(() => { // cneumuel: try without transaction
+      //trans.UseTransaction(() => { // cneumuel: try without transaction
       jobData.LastUpdate = DateTime.Now;
       dao.UpdateJob(job);
@@ -125,5 +127,5 @@
     public void DeleteJob(Guid jobId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.DeleteJob(jobId);
       });
@@ -132,5 +134,5 @@
     public void DeleteChildJobs(Guid parentJobId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var jobs = GetChildJobs(parentJobId, true, false);
         foreach (var job in jobs) {
@@ -143,5 +145,5 @@
     public Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         Job job = dao.UpdateJobState(jobId, jobState, slaveId, userId, exception);
 
@@ -161,4 +163,9 @@
       });
     }
+
+    public IEnumerable<Job> GetJobsByResourceId(Guid resourceId) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
+      return trans.UseTransaction(() => dao.GetJobsByResourceId(resourceId));
+    }
     #endregion
 
@@ -166,5 +173,5 @@
     public void StopJob(Guid jobId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var job = dao.GetJob(jobId);
         if (job.State == JobState.Calculating || job.State == JobState.Transferring) {
@@ -181,5 +188,5 @@
     public void PauseJob(Guid jobId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var job = dao.GetJob(jobId);
         if (job.State == JobState.Calculating || job.State == JobState.Transferring) {
@@ -194,5 +201,5 @@
     public void RestartJob(Guid jobId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         Job job = dao.UpdateJobState(jobId, JobState.Waiting, null, author.UserId, string.Empty);
         job.Command = null;
@@ -223,5 +230,5 @@
     public Guid AddHiveExperiment(HiveExperiment hiveExperimentDto) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         hiveExperimentDto.OwnerUserId = author.UserId;
         hiveExperimentDto.DateCreated = DateTime.Now;
@@ -232,5 +239,5 @@
     public void UpdateHiveExperiment(HiveExperiment hiveExperimentDto) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.UpdateHiveExperiment(hiveExperimentDto);
       });
@@ -239,5 +246,5 @@
     public void DeleteHiveExperiment(Guid hiveExperimentId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         HiveExperiment he = dao.GetHiveExperiment(hiveExperimentId);
         dao.DeleteHiveExperiment(hiveExperimentId); // child jobs will be deleted by db-trigger
@@ -249,5 +256,5 @@
     public void Hello(Slave slaveInfo) {
       authen.AuthenticateForAnyRole(HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var slave = dao.GetSlave(slaveInfo.Id);
 
@@ -280,5 +287,5 @@
     public void GoodBye(Guid slaveId) {
       authen.AuthenticateForAnyRole(HiveRoles.Slave);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var slave = dao.GetSlave(slaveId);
         if (slave != null) {
@@ -294,5 +301,5 @@
       authen.AuthenticateForAnyRole(HiveRoles.Slave);
       TriggerLifecycle(false);
-      return DA.TransactionManager.UseTransaction(() => heartbeatManager.ProcessHeartbeat(heartbeat));
+      return trans.UseTransaction(() => heartbeatManager.ProcessHeartbeat(heartbeat));
     }
     #endregion
@@ -301,5 +308,5 @@
     public Guid AddPlugin(Plugin plugin, List<PluginData> pluginDatas) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         plugin.UserId = author.UserId;
         plugin.DateCreated = DateTime.Now;
@@ -325,4 +332,9 @@
     }
 
+    public Plugin GetPluginByHash(byte[] hash) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
+      return dao.GetPlugins(x => x.Hash == hash).FirstOrDefault();
+    }
+
     public IEnumerable<Plugin> GetPlugins() {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
@@ -334,5 +346,5 @@
       List<PluginData> pluginDatas = new List<PluginData>();
 
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         foreach (Guid guid in pluginIds) {
           pluginDatas.AddRange(dao.GetPluginDatas(x => x.PluginId == guid).ToList());
@@ -342,4 +354,8 @@
     }
 
+    public void DeletePlugin(Guid pluginId) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
+      dao.DeletePlugin(pluginId);
+    }
     #endregion
 
@@ -347,10 +363,10 @@
     public Guid AddSlave(Slave slave) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => dao.AddSlave(slave));
+      return trans.UseTransaction(() => dao.AddSlave(slave));
     }
 
     public Guid AddSlaveGroup(SlaveGroup slaveGroup) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => dao.AddSlaveGroup(slaveGroup));
+      return trans.UseTransaction(() => dao.AddSlaveGroup(slaveGroup));
     }
 
@@ -377,5 +393,5 @@
     public void UpdateSlave(Slave slave) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.UpdateSlave(slave);
       });
@@ -384,5 +400,5 @@
     public void UpdateSlaveGroup(SlaveGroup slaveGroup) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.UpdateSlaveGroup(slaveGroup);
       });
@@ -391,5 +407,5 @@
     public void DeleteSlave(Guid slaveId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.DeleteSlave(slaveId);
       });
@@ -398,5 +414,5 @@
     public void DeleteSlaveGroup(Guid slaveGroupId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         dao.DeleteSlaveGroup(slaveGroupId);
       });
@@ -405,5 +421,5 @@
     public void AddResourceToGroup(Guid slaveGroupId, Guid resourceId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var resource = dao.GetResource(resourceId);
         resource.ParentResourceId = slaveGroupId;
@@ -414,5 +430,5 @@
     public void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         var resource = dao.GetResource(resourceId);
         resource.ParentResourceId = null;
@@ -423,5 +439,5 @@
     public Guid GetResourceId(string resourceName) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return DA.TransactionManager.UseTransaction(() => {
+      return trans.UseTransaction(() => {
         var resource = dao.GetResources(x => x.Name == resourceName).FirstOrDefault();
         if (resource != null) {
@@ -435,5 +451,5 @@
     public void TriggerLifecycle(bool force) {
       // use a serializable transaction here to ensure not two threads execute this simultaniously (mutex-lock would not work since IIS may use multiple AppDomains)
-      DA.TransactionManager.UseTransaction(() => {
+      trans.UseTransaction(() => {
         DateTime lastCleanup = dao.GetLastCleanup();
         if (force || DateTime.Now - lastCleanup > TimeSpan.FromSeconds(59)) {
@@ -462,32 +478,27 @@
     #endregion
 
-    #region Appointment Methods
-    public Guid AddAppointment(Appointment appointment) {
+    #region Downtime Methods
+    public Guid AddDowntime(Downtime downtime) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      return DA.TransactionManager.UseTransaction(() => dao.AddAppointment(appointment));
-    }
-
-    public void DeleteAppointment(Guid appointmentId) {
+      return trans.UseTransaction(() => dao.AddDowntime(downtime));
+    }
+
+    public void DeleteDowntime(Guid downtimeId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      DA.TransactionManager.UseTransaction(() => {
-        dao.DeleteAppointment(appointmentId);
-      });
-    }
-
-    public void UpdateAppointment(Appointment appointment) {
+      trans.UseTransaction(() => {
+        dao.DeleteDowntime(downtimeId);
+      });
+    }
+
+    public void UpdateDowntime(Downtime downtime) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      DA.TransactionManager.UseTransaction(() => {
-        dao.UpdateAppointment(appointment);
-      });
-    }
-
-    public IEnumerable<Appointment> GetScheduleForResource(Guid resourceId) {
+      trans.UseTransaction(() => {
+        dao.UpdateDowntime(downtime);
+      });
+    }
+
+    public IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      return DA.TransactionManager.UseTransaction(() => dao.GetAppointments(x => x.ResourceId == resourceId));
-    }
-
-    public IEnumerable<Job> GetJobsByResourceId(Guid resourceId) {
-      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      return DA.TransactionManager.UseTransaction(() => dao.GetJobsByResourceId(resourceId));
+      return trans.UseTransaction(() => dao.GetDowntimes(x => x.ResourceId == resourceId));
     }
     #endregion
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/IServiceLocator.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/IServiceLocator.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/IServiceLocator.cs	(revision 6452)
@@ -28,4 +28,5 @@
     IHiveDao HiveDao { get; }
     ILifecycleManager LifecycleManager { get; }
+    ITransactionManager TransactionManager { get; }
     HeartbeatManager HeartbeatManager { get; }
   }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs	(revision 6452)
@@ -76,5 +76,5 @@
       var slaves = dao.GetSlaves(x => x.SlaveState != SlaveState.Offline);
       foreach (Slave slave in slaves) {
-        if (!slave.LastHeartbeat.HasValue || (DateTime.Now - slave.LastHeartbeat.Value) > ApplicationConstants.SlaveHeartbeatTimeout) {
+        if (!slave.LastHeartbeat.HasValue || (DateTime.Now - slave.LastHeartbeat.Value) > Settings.Default.SlaveHeartbeatTimeout) {
           slave.SlaveState = SlaveState.Offline;
           SetJobsWaiting(slave.Id);
@@ -107,6 +107,6 @@
     /// </summary>
     private void SetTimeoutJobsWaiting() {
-      var jobs = dao.GetJobs(x => (x.State == JobState.Calculating && (DateTime.Now - x.LastHeartbeat) > ApplicationConstants.CalculatingJobHeartbeatTimeout)
-                               || (x.State == JobState.Transferring && (DateTime.Now - x.LastHeartbeat) > ApplicationConstants.TransferringJobHeartbeatTimeout));
+      var jobs = dao.GetJobs(x => (x.State == JobState.Calculating && (DateTime.Now - x.LastHeartbeat) > Settings.Default.CalculatingJobHeartbeatTimeout)
+                               || (x.State == JobState.Transferring && (DateTime.Now - x.LastHeartbeat) > Settings.Default.TransferringJobHeartbeatTimeout));
       foreach (var j in jobs) {
         Job job = dao.UpdateJobState(j.Id, JobState.Waiting, null, null, "Slave timed out.");
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/ServiceLocator.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/ServiceLocator.cs	(revision 6451)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/ServiceLocator.cs	(revision 6452)
@@ -66,4 +66,12 @@
     }
 
+    private ITransactionManager transactionManager;
+    public ITransactionManager TransactionManager {
+      get {
+        if (transactionManager == null) transactionManager = new TransactionManager();
+        return transactionManager;
+      }
+    }
+
     private HeartbeatManager heartbeatManager;
     public HeartbeatManager HeartbeatManager {
