Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ApplicationConstants.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ApplicationConstants.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ApplicationConstants.cs	(revision 4598)
@@ -33,5 +33,5 @@
     public static System.Transactions.IsolationLevel ISOLATION_LEVEL_SCOPE = System.Transactions.IsolationLevel.ReadUncommitted;
 
-    public static int HEARTBEAT_MAX_DIF = 120; // value in seconds
+    public static int HEARTBEAT_TIMEOUT = 120; // value in seconds
     
     public static int JOB_TIME_TO_LIVE = 5;
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HivePluginData.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HivePluginData.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/HivePluginData.cs	(revision 4598)
@@ -22,5 +22,4 @@
 using System;
 using System.Runtime.Serialization;
-using HeuristicLab.Common;
 
 namespace HeuristicLab.Services.Hive.Common.DataTransfer {
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/Job.cs	(revision 4598)
@@ -34,5 +34,5 @@
     public Guid UserId { get; set; }
     [DataMember]
-    public Slave Slave { get; set; }
+    public Guid SlaveId { get; set; }
     [DataMember]
     public int Priority { get; set; }
@@ -42,17 +42,17 @@
     public int MemoryNeeded { get; set; }
     [DataMember]
-    public List<HivePlugin> PluginsNeeded { get; set; }
+    public List<Guid> PluginsNeededIds { get; set; }
     [DataMember]
     public List<Guid> AssignedResourceIds { get; set; }
     [DataMember]
-    public Project Project { get; set; }
+    public Guid ProjectId { get; set; }
 
     public override string ToString() {
-      return base.ToString() + "State: " + State + ", [Ressource : " + Slave + " ] , DateCreated: " + DateCreated + ", DateCalculated: " + DateCalculated +
+      return base.ToString() + "State: " + State + ", [SlaveId : " + SlaveId + " ] , DateCreated: " + DateCreated + ", DateCalculated: " + DateCalculated +
         "Priority: " + Priority + ", CoresNeeded: " + CoresNeeded + "AssignedResources: " + AssignedResourceIds;
     }
 
     public Job() {
-      PluginsNeeded = new List<HivePlugin>();
+      PluginsNeededIds = new List<Guid>();
       AssignedResourceIds = new List<Guid>();
     }
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobData.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobData.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobData.cs	(revision 4598)
@@ -23,5 +23,4 @@
 using System.IO;
 using System.Runtime.Serialization;
-using HeuristicLab.Common;
 
 namespace HeuristicLab.Services.Hive.Common.DataTransfer {
@@ -30,5 +29,5 @@
   public class JobData : HiveItem {
     [DataMember]
-    public Job Job { get; set; }
+    public Guid JobId { get; set; }
     [DataMember]
     public byte[] Data { get; set; }
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobState.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobState.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/JobState.cs	(revision 4598)
@@ -31,5 +31,5 @@
     /// Job is waiting to be calculated
     /// </summary>
-    Offline,
+    Waiting,
 
     /// <summary>
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/LightweightJob.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/LightweightJob.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/DataTransfer/LightweightJob.cs	(revision 4598)
@@ -43,4 +43,17 @@
     [DataMember]
     public Guid? ParentJobId { get; set; }
+
+    public LightweightJob() { }
+
+    public LightweightJob(Job job) {
+      this.SlaveId = job.SlaveId;
+      this.State = job.State;
+      this.ExecutionTime = job.ExecutionTime;
+      this.Exception = job.Exception;
+      this.DateCreated = job.DateCreated;
+      this.DateCalculated = job.DateCalculated;
+      this.DateFinished = job.DateFinished;
+      this.ParentJobId = job.ParentJobId;
+    }
   }
 }
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/Disposable.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/Disposable.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/Disposable.cs	(revision 4598)
@@ -0,0 +1,42 @@
+﻿#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;
+
+namespace HeuristicLab.Services.Hive.Common {
+  public class Disposable<T> : IDisposable {
+    private T obj;
+    public T Obj {
+      get { return obj; }
+    }
+
+    public Disposable(T obj) {
+      this.obj = obj;
+    }
+
+    public void Dispose() {
+      if (OnDisposing != null)
+        OnDisposing(this, new EventArgs());
+    }
+
+    public event EventHandler OnDisposing;
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/HeuristicLab.Services.Hive.Common-3.3.csproj
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/HeuristicLab.Services.Hive.Common-3.3.csproj	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/HeuristicLab.Services.Hive.Common-3.3.csproj	(revision 4598)
@@ -66,4 +66,5 @@
     <Compile Include="DataTransfer\LightweightJob.cs" />
     <Compile Include="DataTransfer\JobState.cs" />
+    <Compile Include="Disposable.cs" />
     <Compile Include="MessageContainer.cs" />
     <Compile Include="DataTransfer\NamedHiveItem.cs" />
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ServiceContracts/IHiveService.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ServiceContracts/IHiveService.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Common/3.3/ServiceContracts/IHiveService.cs	(revision 4598)
@@ -15,43 +15,68 @@
     #region Job Methods
     [OperationContract]
-    Job AddJob(JobData job);
+    Guid AddJob(Job jobDto, JobData jobDataDto);
+
     [OperationContract]
-    Job AddJobWithGroupStrings(JobData jobObj, IEnumerable<string> groups);
+    Guid AddChildJob(Guid parentJobId, Job jobDto, JobData jobDataDto);
+
+    [OperationContract] // formerly GetJobById
+    Job GetJob(Guid jobId);
+
+    [OperationContract] // formerly GetAllJobs
+    IEnumerable<Job> GetJobs();
+
+    [OperationContract] // formerly GetJobResults
+    IEnumerable<LightweightJob> GetLightweightJobs(IEnumerable<Guid> jobIds);
+
+    [OperationContract] // formerly GetChildJobResults
+    IEnumerable<LightweightJob> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent);
+
+    [OperationContract] // formerly GetLastSerializedResult
+    JobData GetJobData(Guid jobId);
+
     [OperationContract]
-    JobData GetLastSerializedResult(Guid jobId);
+    Stream GetJobDataStreamed(Guid jobId);
+
+    [OperationContract]
+    void UpdateJob(Job jobDto, JobData jobDataDto);
+        
+    [OperationContract] // formerly StoreFinishedJobResultStreamed
+    void UpdateJobDataStreamed(Stream stream);
+
+    [OperationContract]
+    void DeleteChildJobs(Guid parentJobId);
+
+    [OperationContract] // new method: appropriate job is choosen and set to 'calculating'. the slave is responsible for requesting the jobData. Server should wait some timeout until he redistributes the job
+    Job AquireJob(Guid slaveId);
+
+    //[OperationContract] // dump?
+    //Job GetJobByIdWithDetails(Guid jobId);
+
+    //[OperationContract] dump?
+    //Job AddNewJob(JobData job);
+
+    //[OperationContract]
+    //void RemoveJob(Guid jobId);
+
+    //[OperationContract] // GetJobForCalculation (was this used?
+    //Job GetJob(Guid slaveId);
+
+    //[OperationContract] --> replaced by UpdateJob
+    //void StoreFinishedJobResult(Guid slaveId, Guid jobId, byte[] result, TimeSpan executionTime, string exception);
+
+    //[OperationContract] dump this! a slave should just check if job is still offline, if so it can submit the finished job, otherwise throw away! its a rare case that a slave reawakes with a finished job
+    //void IsJobStillNeeded(Guid jobId);
+
+    //[OperationContract] // dump?
+    //Job AddJobWithGroupStrings(JobData jobObj, IEnumerable<string> groups);
+    #endregion
+
+
+    #region Job Control Methods
     [OperationContract]
     void AbortJob(Guid jobId);
-    [OperationContract]
-    Job GetJobById(Guid jobId);
-    [OperationContract]
-    IEnumerable<LightweightJob> GetJobResults(IEnumerable<Guid> jobIds);
-    [OperationContract]
-    IEnumerable<LightweightJob> GetChildJobResults(Guid? parentJobId, bool recursive, bool includeParent);
-    [OperationContract]
-    Job AddChildJob(Guid parentJobId, JobData serializedJob);
-    [OperationContract]
-    Job GetAllJobsWithFilter(JobState jobState, int offset, int count);
-    [OperationContract]
-    Job GetAllJobs();
-    [OperationContract]
-    Job GetJobByIdWithDetails(Guid jobId);
-    [OperationContract]
-    Job AddNewJob(JobData job);
-    //[OperationContract]
-    //void RemoveJob(Guid jobId);
+
     [OperationContract]
     Job PauseJob(JobData serializedJob);
-    [OperationContract]
-    void DeleteChildJobs(Guid jobId);
-    [OperationContract]
-    Job GetJob(Guid clientId);
-    [OperationContract]
-    void StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception);
-    [OperationContract]
-    void IsJobStillNeeded(Guid jobId);
-    [OperationContract]
-    Stream GetStreamedJob(Guid clientId);
-    [OperationContract]
-    void StoreFinishedJobResultStreamed(Stream stream);
     #endregion
 
@@ -62,6 +87,8 @@
     [OperationContract]
     IEnumerable<HiveExperiment> GetHiveExperiments();
+
     [OperationContract]
-    HiveExperiment UpdateHiveExperiment(HiveExperiment hiveExperimentDto);
+    void UpdateHiveExperiment(HiveExperiment hiveExperimentDto);
+
     [OperationContract]
     void DeleteHiveExperiment(Guid hiveExperimentId);
@@ -123,23 +150,26 @@
     #region Slave Methods
     [OperationContract]
-    IEnumerable<Slave> GetAllSlaves();
+    Guid AddSlaveGroup(SlaveGroup slaveGroup);
+
     [OperationContract]
-    [ServiceKnownType(typeof(Resource))]
-    [ServiceKnownType(typeof(Slave))]
-    [ServiceKnownType(typeof(SlaveGroup))]
-    IEnumerable<SlaveGroup> GetAllSlaveGroups();
+    IEnumerable<Slave> GetSlaves();
+    
     [OperationContract]
-    IEnumerable<SlaveGroup> GetAllGroupsOfResource(Guid resourceId);
-    [OperationContract]
-    SlaveGroup AddSlaveGroup(SlaveGroup clientGroup);
+    //[ServiceKnownType(typeof(Resource))] - not sure about those
+    //[ServiceKnownType(typeof(Slave))]
+    //[ServiceKnownType(typeof(SlaveGroup))]
+    IEnumerable<SlaveGroup> GetSlaveGroups();
+
     [OperationContract]
     void DeleteSlaveGroup(Guid clientGroupId);
+
     [OperationContract]
-    [ServiceKnownType(typeof(Resource))]
-    [ServiceKnownType(typeof(Slave))]
-    [ServiceKnownType(typeof(SlaveGroup))]
-    void AddResourceToGroup(Guid clientGroupId, Resource resource);
+    //[ServiceKnownType(typeof(Resource))]
+    //[ServiceKnownType(typeof(Slave))]
+    //[ServiceKnownType(typeof(SlaveGroup))]
+    void AddResourceToGroup(Guid slaveGroupId, Resource resource);
+
     [OperationContract]
-    void DeleteResourceFromGroup(Guid clientGroupId, Guid resourceId);
+    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
     #endregion
     
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/ContextFactory.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/ContextFactory.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/ContextFactory.cs	(revision 4598)
@@ -31,4 +31,6 @@
 
 namespace HeuristicLab.Services.Hive.DataAccess {
+  public delegate T CreateDataContext<T>() where T : DataContext;
+
   /// <summary>
   /// This class handles creates one Context for each Thread which asks for one.
@@ -39,19 +41,13 @@
   /// it has to be disposed in order to finish the corresponding transaction.
   /// </summary>
-  public class ContextFactory : IContextFactory {
+  public class ContextFactory<T> : IContextFactory<T> where T : DataContext {
     private static object locker = new object();
-    private static IDictionary<int, HiveDataContext> contexts = new Dictionary<int, HiveDataContext>();
+    private static IDictionary<int, Disposable<T>> contexts = new Dictionary<int, Disposable<T>>();
     private static IDictionary<int, TransactionScope> transactions = new Dictionary<int, TransactionScope>();
+    private CreateDataContext<T> createDataContext;
 
-    private static IContextFactory instance = null;
-    public static IContextFactory Instance {
-      get {
-        if (instance == null)
-          instance = new ContextFactory();
-        return instance;
-      }
+    public ContextFactory(CreateDataContext<T> createDataContext) {
+      this.createDataContext = createDataContext;
     }
-
-    #region IContextManager Members
 
     public IDisposable GetContext() {
@@ -69,7 +65,9 @@
         }
 
-        DisposableHiveDataContext context = CreateContext();
-        context.OnDisposing += new EventHandler(context_OnDisposing);
-        contexts.Add(threadId, context);
+        T context = createDataContext();
+       
+        Disposable<T> disposableContext = new Disposable<T>(context);
+        disposableContext.OnDisposing += new EventHandler(context_OnDisposing);
+        contexts.Add(threadId, disposableContext);
 
         if (withTransaction) {
@@ -79,8 +77,4 @@
         return context;
       }
-    }
-
-    private static DisposableHiveDataContext CreateContext() {
-      return new DisposableHiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
     }
 
@@ -102,5 +96,5 @@
       lock (locker) {
         int threadId = Thread.CurrentThread.ManagedThreadId;
-
+        contexts[threadId].Dispose();
         contexts.Remove(threadId);
         // context gets disposed implicitly, when it is used as IDisposable
@@ -126,12 +120,12 @@
     }
 
-    public DataContext CurrentContext {
+    public T CurrentContext {
       get {
         lock (locker) {
           int threadId = Thread.CurrentThread.ManagedThreadId;
           if (contexts.ContainsKey(threadId)) {
-            return contexts[threadId];
+            return contexts[threadId].Obj;
           } else {
-            return null;
+            return default(T);
           }
         }
@@ -139,21 +133,7 @@
     }
 
-    #endregion
-  }
-
-  /// <summary>
-  /// Offers an event when it gets disposed
-  /// </summary>
-  class DisposableHiveDataContext : HiveDataContext {
-
-    public DisposableHiveDataContext(string connection) : base(connection) { }
-
-    protected override void Dispose(bool disposing) {
-      base.Dispose(disposing);
-      if (OnDisposing != null)
-        OnDisposing(this, new EventArgs());
+    public static HiveDataContext CreateHiveContext() {
+      return new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
     }
-
-    public event EventHandler OnDisposing;
   }
 }
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs	(revision 4598)
@@ -0,0 +1,127 @@
+﻿#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.Collections.Generic;
+using System.Data.Linq;
+using System.Linq;
+using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  public static class Convert {
+
+   
+    #region Job
+    public static DT.Job ToDto(Job source) {
+      if (source == null) return null;
+      return new DT.Job { Id = source.JobId };// todo
+    }
+    public static Job ToEntity(DT.Job source) {
+      if (source == null) return null;
+      return new Job { JobId = source.Id };// todo
+    }
+    public static void ToEntity(DT.Job source, Job target) {
+      if ((source != null) && (target != null)) {
+        target.JobId = source.Id;// todo
+      }
+    }
+    #endregion
+
+    #region JobData
+    public static DT.JobData ToDto(JobData source) {
+      if (source == null) return null;
+      return new DT.JobData { JobId = source.JobId };// todo
+    }
+    public static JobData ToEntity(DT.JobData source) {
+      if (source == null) return null;
+      return new JobData { JobId = source.Id };// todo
+    }
+    public static void ToEntity(DT.JobData source, JobData target) {
+      if ((source != null) && (target != null)) {
+        target.JobId = source.Id;// todo
+      }
+    }
+    #endregion
+    
+    #region HiveExperiment
+    public static DT.HiveExperiment ToDto(HiveExperiment source) {
+      if (source == null) return null;
+      return new DT.HiveExperiment { Id = source.HiveExperimentId };// todo
+    }
+    public static HiveExperiment ToEntity(DT.HiveExperiment source) {
+      if (source == null) return null;
+      return new HiveExperiment { HiveExperimentId = source.Id };// todo
+    }
+    public static void ToEntity(DT.HiveExperiment source, HiveExperiment target) {
+      if ((source != null) && (target != null)) {
+        target.HiveExperimentId = source.Id;// todo
+      }
+    }
+    #endregion
+
+    #region Slave
+    public static DT.Slave ToDto(Slave source) {
+      if (source == null) return null;
+      return new DT.Slave { Id = source.ResourceId };// todo
+    }
+    public static Slave ToEntity(DT.Slave source) {
+      if (source == null) return null;
+      return new Slave { ResourceId = source.Id };// todo
+    }
+    public static void ToEntity(DT.Slave source, Slave target) {
+      if ((source != null) && (target != null)) {
+        target.ResourceId = source.Id;// todo
+      }
+    }
+    #endregion
+
+    #region SlaveGroup
+    public static DT.SlaveGroup ToDto(SlaveGroup source) {
+      if (source == null) return null;
+      return new DT.SlaveGroup { Id = source.ResourceId };// todo
+    }
+    public static SlaveGroup ToEntity(DT.SlaveGroup source) {
+      if (source == null) return null;
+      return new SlaveGroup { ResourceId = source.Id };// todo
+    }
+    public static void ToEntity(DT.SlaveGroup source, SlaveGroup target) {
+      if ((source != null) && (target != null)) {
+        target.ResourceId = source.Id;// todo
+      }
+    }
+    #endregion
+
+    #region Resource
+    public static DT.Resource ToDto(Resource source) {
+      if (source == null) return null;
+      return new DT.Resource { Id = source.ResourceId };// todo
+    }
+    public static Resource ToEntity(DT.Resource source) {
+      if (source == null) return null;
+      return new Resource { ResourceId = source.Id };// todo
+    }
+    public static void ToEntity(DT.Resource source, Resource target) {
+      if ((source != null) && (target != null)) {
+        target.ResourceId = source.Id;// todo
+      }
+    }
+    #endregion
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 4598)
@@ -56,5 +56,7 @@
   <ItemGroup>
     <Compile Include="ContextFactory.cs" />
+    <Compile Include="Convert.cs" />
     <Compile Include="HeuristicLabServicesHiveDataAccessPlugin.cs" />
+    <Compile Include="HiveDao.cs" />
     <Compile Include="HiveDataContext.cs">
       <DependentUpon>HiveDataContext.dbml</DependentUpon>
@@ -66,4 +68,5 @@
     </Compile>
     <Compile Include="Interfaces\IContextFactory.cs" />
+    <Compile Include="Interfaces\IHiveDao.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\Settings.Designer.cs">
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs	(revision 4598)
@@ -0,0 +1,211 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Linq.Expressions;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
+
+  public class HiveDao : IHiveDao {
+    private IContextFactory<HiveDataContext> contextFactory;
+    private DataAccess.HiveDataContext db { get { return contextFactory.CurrentContext; } }
+
+    public HiveDao(IContextFactory<HiveDataContext> contextFactory) {
+      this.contextFactory = contextFactory;
+    }
+
+    #region Job Methods
+    public DT.Job GetJob(Guid id) {
+      return Convert.ToDto(db.Jobs.SingleOrDefault(x => x.JobId == id));
+    }
+
+    public IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate) {
+      return db.Jobs.Where(predicate).Select(x => Convert.ToDto(x));
+    }
+
+    public Guid AddJob(DT.Job dto) {
+      var entity = Convert.ToEntity(dto);
+      db.Jobs.InsertOnSubmit(entity);
+      db.SubmitChanges();
+      return entity.JobId;
+    }
+
+    public void UpdateJob(DT.Job dto) {
+      var entity = db.Jobs.FirstOrDefault(x => x.JobId == dto.Id);
+      if (entity == null) db.Jobs.InsertOnSubmit(Convert.ToEntity(dto));
+      else Convert.ToEntity(dto, entity);
+      db.SubmitChanges();
+    }
+
+    public void DeleteJob(Guid id) {
+      var entity = db.Jobs.FirstOrDefault(x => x.JobId == id);
+      if (entity != null) db.Jobs.DeleteOnSubmit(entity);
+      db.SubmitChanges();
+    }
+    #endregion
+
+    #region JobData Methods
+
+    public DT.JobData GetJobData(Guid id) {
+      return Convert.ToDto(db.JobDatas.SingleOrDefault(x => x.JobId == id));
+    }
+
+    public IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate) {
+      return db.JobDatas.Where(predicate).Select(x => Convert.ToDto(x));
+    }
+
+    public Guid AddJobData(DT.JobData dto) {
+      var entity = Convert.ToEntity(dto);
+      db.JobDatas.InsertOnSubmit(entity);
+      db.SubmitChanges();
+      return entity.JobId;
+    }
+
+    public void UpdateJobData(DT.JobData dto) {
+      var entity = db.JobDatas.FirstOrDefault(x => x.JobId == dto.Id);
+      if (entity == null) db.JobDatas.InsertOnSubmit(Convert.ToEntity(dto));
+      else Convert.ToEntity(dto, entity);
+      db.SubmitChanges();
+    }
+
+    public void DeleteJobData(Guid id) {
+      var entity = db.JobDatas.FirstOrDefault(x => x.JobId == id); // check if all the byte[] is loaded into memory here. otherwise work around to delete without loading it
+      if (entity != null) db.JobDatas.DeleteOnSubmit(entity);
+      db.SubmitChanges();
+    }
+    #endregion
+
+    #region HiveExperiment Methods
+    public DT.HiveExperiment GetHiveExperiment(Guid id) {
+      return Convert.ToDto(db.HiveExperiments.SingleOrDefault(x => x.HiveExperimentId == id));
+    }
+
+    public IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate) {
+      return db.HiveExperiments.Where(predicate).Select(x => Convert.ToDto(x));
+    }
+
+    public Guid AddHiveExperiment(DT.HiveExperiment dto) {
+      var entity = Convert.ToEntity(dto);
+      db.HiveExperiments.InsertOnSubmit(entity);
+      db.SubmitChanges();
+      return entity.HiveExperimentId;
+    }
+
+    public void UpdateHiveExperiment(DT.HiveExperiment dto) {
+      var entity = db.HiveExperiments.FirstOrDefault(x => x.HiveExperimentId == dto.Id);
+      if (entity == null) db.HiveExperiments.InsertOnSubmit(Convert.ToEntity(dto));
+      else Convert.ToEntity(dto, entity);
+      db.SubmitChanges();
+    }
+
+    public void DeleteHiveExperiment(Guid id) {
+      var entity = db.HiveExperiments.FirstOrDefault(x => x.HiveExperimentId == id);
+      if (entity != null) db.HiveExperiments.DeleteOnSubmit(entity);
+      db.SubmitChanges();
+    }
+    #endregion
+
+
+    #region Slave Methods
+    public DT.Slave GetSlave(Guid id) {
+      return Convert.ToDto(db.Resources.OfType<Slave>().SingleOrDefault(x => x.ResourceId == id));
+    }
+
+    public IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate) {
+      return db.Resources.OfType<Slave>().Where(predicate).Select(x => Convert.ToDto(x));
+    }
+
+    public Guid AddSlave(DT.Slave dto) {
+      var entity = Convert.ToEntity(dto);
+      db.Resources.InsertOnSubmit(entity);
+      db.SubmitChanges();
+      return entity.ResourceId;
+    }
+
+    public void UpdateSlave(DT.Slave dto) {
+      var entity = db.Resources.OfType<Slave>().FirstOrDefault(x => x.ResourceId == dto.Id);
+      if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
+      else Convert.ToEntity(dto, entity);
+      db.SubmitChanges();
+    }
+
+    public void DeleteSlave(Guid id) {
+      var entity = db.Resources.OfType<Slave>().FirstOrDefault(x => x.ResourceId == id);
+      if (entity != null) db.Resources.DeleteOnSubmit(entity);
+      db.SubmitChanges();
+    }
+    #endregion
+
+    #region SlaveGroup Methods
+    public DT.SlaveGroup GetSlaveGroup(Guid id) {
+      return Convert.ToDto(db.Resources.OfType<SlaveGroup>().SingleOrDefault(x => x.ResourceId == id));
+    }
+
+    public IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate) {
+      return db.Resources.OfType<SlaveGroup>().Where(predicate).Select(x => Convert.ToDto(x));
+    }
+
+    public Guid AddSlaveGroup(DT.SlaveGroup dto) {
+      var entity = Convert.ToEntity(dto);
+      db.Resources.InsertOnSubmit(entity);
+      db.SubmitChanges();
+      return entity.ResourceId;
+    }
+
+    public void UpdateSlaveGroup(DT.SlaveGroup dto) {
+      var entity = db.Resources.OfType<SlaveGroup>().FirstOrDefault(x => x.ResourceId == dto.Id);
+      if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
+      else Convert.ToEntity(dto, entity);
+      db.SubmitChanges();
+    }
+
+    public void DeleteSlaveGroup(Guid id) {
+      var entity = db.Resources.OfType<SlaveGroup>().FirstOrDefault(x => x.ResourceId == id);
+      if (entity != null) db.Resources.DeleteOnSubmit(entity);
+      db.SubmitChanges();
+    }
+    #endregion
+
+    #region Resource Methods
+    public DT.Resource GetResource(Guid id) {
+      return Convert.ToDto(db.Resources.SingleOrDefault(x => x.ResourceId == id));
+    }
+
+    public IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate) {
+      return db.Resources.Where(predicate).Select(x => Convert.ToDto(x));
+    }
+
+    public Guid AddResource(DT.Resource dto) {
+      var entity = Convert.ToEntity(dto);
+      db.Resources.InsertOnSubmit(entity);
+      db.SubmitChanges();
+      return entity.ResourceId;
+    }
+
+    public void UpdateResource(DT.Resource dto) {
+      var entity = db.Resources.FirstOrDefault(x => x.ResourceId == dto.Id);
+      if (entity == null) db.Resources.InsertOnSubmit(Convert.ToEntity(dto));
+      else Convert.ToEntity(dto, entity);
+      db.SubmitChanges();
+    }
+
+    public void DeleteResource(Guid id) {
+      var entity = db.Resources.FirstOrDefault(x => x.ResourceId == id);
+      if (entity != null) db.Resources.DeleteOnSubmit(entity);
+      db.SubmitChanges();
+    }
+    #endregion
+
+    #region Authorization Methods
+    public bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds) {
+      var userIds = from job in db.Jobs // this needs to be fast!
+                 where jobIds.Contains(job.JobId)
+                 select job.UserId;
+      return userIds.All(x => x == userId);
+    }
+    #endregion
+
+
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 4598)
@@ -35,6 +35,6 @@
     </Type>
   </Table>
-  <Table Name="dbo.PluginInfo" Member="PluginInfos">
-    <Type Name="PluginInfo">
+  <Table Name="dbo.Plugin" Member="Plugins">
+    <Type Name="Plugin">
       <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
       <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
@@ -42,4 +42,5 @@
       <Column Name="BuildDate" Type="System.String" DbType="VarChar(20)" CanBeNull="false" />
       <Association Name="PluginInfo_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
+      <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One" />
     </Type>
   </Table>
@@ -56,5 +57,5 @@
       <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
       <Column Name="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="PluginInfo" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="PluginInfo_RequiredPlugin" Member="Plugin" Storage="_PluginInfo" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" DeleteRule="CASCADE" />
       <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
     </Type>
@@ -97,5 +98,4 @@
       <Column Name="ExecutionTime" Type="System.TimeSpan" DbType="Time" CanBeNull="true" />
       <Column Name="Exception" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
-      <Column Name="SerializedJob" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="false" UpdateCheck="Never" IsDelayLoaded="true" />
       <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
       <Column Name="DateCalculated" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
@@ -109,4 +109,5 @@
       <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
       <Association Name="Job_Job" Member="Jobs" ThisKey="JobId" OtherKey="ParentJobId" Type="Job" />
+      <Association Name="Job_JobData" Member="JobData" ThisKey="JobId" OtherKey="JobId" Type="JobData" Cardinality="One" />
       <Association Name="Job_Job" Member="Job1" ThisKey="ParentJobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
       <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="SET NULL" />
@@ -137,3 +138,17 @@
     </Type>
   </Table>
+  <Table Name="" Member="JobDatas">
+    <Type Name="JobData">
+      <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
+      <Column Member="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="false" UpdateCheck="Never" />
+      <Association Name="Job_JobData" Member="Job" ThisKey="JobId" OtherKey="JobId" Type="Job" IsForeignKey="true" />
+    </Type>
+  </Table>
+  <Table Name="" Member="PluginDatas">
+    <Type Name="PluginData">
+      <Column Member="PluginId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
+      <Column Name="Data" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX) NOT NULL" CanBeNull="false" UpdateCheck="Never" />
+      <Association Name="Plugin_PluginData" Member="Plugin" ThisKey="PluginId" OtherKey="PluginId" Type="Plugin" IsForeignKey="true" />
+    </Type>
+  </Table>
 </Database>
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 4598)
@@ -1,85 +1,85 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.625, 18.375" name="HiveDataContext">
+<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.25, 12.5" name="HiveDataContext">
   <DataContextMoniker Name="/HiveDataContext" />
   <nestedChildShapes>
-    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="13, 8, 2, 1.3862939453124987">
+    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="12.75, 2.875, 2, 1.3862939453124987">
       <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
       <nestedChildShapes>
-        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="13.015, 8.46, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="3176614f-3038-41e5-8e75-cdf99373cb3d" absoluteBounds="6.25, 8.375, 2, 1.5785953776041666">
+        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="12.765, 3.3350000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="3176614f-3038-41e5-8e75-cdf99373cb3d" absoluteBounds="4.5, 2.125, 2, 1.5785953776041666">
       <DataClassMoniker Name="/HiveDataContext/UptimeStatistic" />
       <nestedChildShapes>
-        <elementListCompartment Id="35235ffe-b21e-49da-b58a-27423444612a" absoluteBounds="6.2650000000000006, 8.835, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="5d9c7dad-8113-49c9-bdfa-c64543554a7b" absoluteBounds="4, 8.5, 2, 1.3862939453125023">
+        <elementListCompartment Id="35235ffe-b21e-49da-b58a-27423444612a" absoluteBounds="4.5150000000000006, 2.5850000000000009, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="5d9c7dad-8113-49c9-bdfa-c64543554a7b" absoluteBounds="7, 0.75, 2, 1.3862939453125023">
       <DataClassMoniker Name="/HiveDataContext/SlaveConfig" />
       <nestedChildShapes>
-        <elementListCompartment Id="c2e15bc8-44cb-42af-b195-b9a30f61af28" absoluteBounds="4.0150000000000006, 8.96, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="7edeab13-5aa7-4b63-8c5e-cae056298001" absoluteBounds="9.625, 12.375, 2, 1.3862939453125023">
+        <elementListCompartment Id="c2e15bc8-44cb-42af-b195-b9a30f61af28" absoluteBounds="7.0150000000000006, 1.2100000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="7edeab13-5aa7-4b63-8c5e-cae056298001" absoluteBounds="15, 2.875, 2, 1.3862939453125023">
       <DataClassMoniker Name="/HiveDataContext/SlaveGroup_Resource" />
       <nestedChildShapes>
-        <elementListCompartment Id="b84f48de-4352-4df2-a7da-ff7cbc1fe702" absoluteBounds="9.64, 12.835, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9.25, 15.375, 2, 1.5785953776041666">
-      <DataClassMoniker Name="/HiveDataContext/PluginInfo" />
-      <nestedChildShapes>
-        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.265, 15.835, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="85f04409-b6e0-4e2f-a140-7191436a806f" absoluteBounds="6.5, 16.875, 2, 1.1939925130208309">
+        <elementListCompartment Id="b84f48de-4352-4df2-a7da-ff7cbc1fe702" absoluteBounds="15.015, 3.3350000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.5785953776041666">
+      <DataClassMoniker Name="/HiveDataContext/Plugin" />
+      <nestedChildShapes>
+        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="85f04409-b6e0-4e2f-a140-7191436a806f" absoluteBounds="5, 8.25, 2, 1.1939925130208309">
       <DataClassMoniker Name="/HiveDataContext/Project" />
       <nestedChildShapes>
-        <elementListCompartment Id="59e11457-6078-47f4-8ee6-eb2052868699" absoluteBounds="6.5150000000000006, 17.335, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="12, 5.5, 2, 1.3862939453124987">
+        <elementListCompartment Id="59e11457-6078-47f4-8ee6-eb2052868699" absoluteBounds="5.0150000000000006, 8.71, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="9.25, 8.875, 2, 1.3862939453124987">
       <DataClassMoniker Name="/HiveDataContext/RequiredPlugin" />
       <nestedChildShapes>
-        <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="12.015, 5.96, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="12.375, 2.875, 2, 1.3862939453125005">
+        <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="9.265, 9.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.75, 0.75, 2, 1.3862939453125005">
       <DataClassMoniker Name="/HiveDataContext/Resource" />
       <nestedChildShapes>
-        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="12.39, 3.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="9.25, 4.375, 2, 3.6939111328124987">
+        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.765, 1.21, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="9.25, 4.375, 2, 3.5016097005208326">
       <DataClassMoniker Name="/HiveDataContext/Job" />
       <nestedChildShapes>
-        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="9.265, 4.835, 1.9700000000000002, 3.1339111328125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="9.625, 9.25, 2, 2.1554996744791666">
+        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="9.265, 4.835, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="11.75, 4.625, 2, 2.1554996744791666">
       <DataClassMoniker Name="/HiveDataContext/UptimeCalendar" />
       <nestedChildShapes>
-        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="9.64, 9.71, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="6, 10.75, 2, 1.9631982421875005">
+        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="11.765, 5.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.875, 6, 2, 1.9631982421875005">
       <DataClassMoniker Name="/HiveDataContext/HiveExperiment" />
       <nestedChildShapes>
-        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="6.0150000000000006, 11.21, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="7.75, 0.75, 2, 2.9247054036458326">
+        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.8900000000000006, 6.4600000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="9.375, 0.75, 2, 2.9247054036458326">
       <DataClassMoniker Name="/HiveDataContext/Slave" />
       <nestedChildShapes>
-        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="7.7650000000000006, 1.21, 1.9700000000000002, 2.364705403645833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="15.375, 5, 2, 0.80938964843749961">
+        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="9.39, 1.21, 1.9700000000000002, 2.364705403645833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="14, 0.75, 2, 0.80938964843749961">
       <DataClassMoniker Name="/HiveDataContext/SlaveGroup" />
       <nestedChildShapes>
-        <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="15.375, 5, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <inheritanceConnector edgePoints="[(12.375 : 3.27485270182292); (9.75 : 3.27485270182292)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+        <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="14, 0.75, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <inheritanceConnector edgePoints="[(11.75 : 1.44314697265625); (11.375 : 1.44314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
       <nodes>
         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
@@ -87,5 +87,5 @@
       </nodes>
     </inheritanceConnector>
-    <inheritanceConnector edgePoints="[(13.265623 : 4.2612939453125); (13.265623 : 4.625); (16.375 : 4.625); (16.375 : 5)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+    <inheritanceConnector edgePoints="[(13.75 : 1.15469482421875); (14 : 1.15469482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
       <nodes>
         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
@@ -93,5 +93,5 @@
       </nodes>
     </inheritanceConnector>
-    <associationConnector edgePoints="[(14.21875 : 4.2612939453125); (14.21875 : 8)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(13.25 : 2.1362939453125); (13.25 : 2.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
       <nodes>
@@ -100,5 +100,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(11.25 : 7.44314447265625); (11.6666666666667 : 7.44314447265625 : JumpStart); (11.8333333333333 : 7.44314447265625 : JumpEnd); (14.6406275 : 7.44314447265625); (14.6406275 : 8)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11.25 : 7.20274983723958); (14.34375 : 7.20274983723958); (14.34375 : 4.2612939453125)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
       <nodes>
@@ -107,5 +107,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8 : 3.67470540364583); (8 : 8.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(9.375 : 2.93674967447917); (6.5 : 2.93674967447917)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Slave/Slave_UptimeStatistic" />
       <nodes>
@@ -114,5 +114,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(16.375 : 5.8093896484375); (16.375 : 13.0681469726563); (12.5520833333333 : 13.0681469726563 : JumpStart); (12.3854166666667 : 13.0681469726563 : JumpEnd); (11.625 : 13.0681469726563)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(15.6910576194798 : 1.5593896484375); (15.6910576194798 : 2.875)]" fixedFrom="Algorithm" fixedTo="Caller">
       <AssociationMoniker Name="/HiveDataContext/SlaveGroup/SlaveGroup_SlaveGroup_Resource" />
       <nodes>
@@ -121,5 +121,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(13.265623 : 4.2612939453125); (13.265623 : 5.25); (11.75 : 5.25); (11.75 : 9); (11.875 : 9); (11.875 : 12.6903214863281); (11.625 : 12.6903214863281)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(13.75 : 2.1362939453125); (14.125 : 2.5112939453125); (15.3497974555544 : 2.5112939453125); (15.3497974555544 : 2.875)]" fixedFrom="NotFixed" fixedTo="Caller">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_SlaveGroup_Resource" />
       <nodes>
@@ -128,6 +128,6 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(11.25 : 16.1642976888021); (12.46875 : 16.1642976888021); (12.46875 : 6.8862939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/PluginInfo/PluginInfo_RequiredPlugin" />
+    <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Plugin/PluginInfo_RequiredPlugin" />
       <nodes>
         <classShapeMoniker Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" />
@@ -135,5 +135,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(11.25 : 6.19314697265625); (12 : 6.19314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(10.25 : 7.87660970052083); (10.25 : 8.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
       <nodes>
@@ -142,5 +142,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(5 : 8.5); (5 : 2.21235270182292); (7.75 : 2.21235270182292)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(9 : 1.44314697265625); (9.375 : 1.44314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/SlaveConfig/SlaveConfig_Slave" />
       <nodes>
@@ -149,5 +149,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(10.25 : 8.0689111328125); (10.25 : 8.3189111328125); (10.6930769230769 : 8.3189111328125); (10.6930769230769 : 8.0689111328125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11.0834359271285 : 7.87660970052083); (11.0834359271285 : 7.95910970052083); (11.1656121961154 : 7.95910970052083); (11.1656121961154 : 8.12660970052083); (10.5546153846154 : 8.12660970052083); (10.5546153846154 : 7.87660970052083)]" manuallyRouted="true" fixedFrom="Caller" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
       <nodes>
@@ -156,5 +156,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.40625 : 16.875); (8.40625 : 6.22195556640625); (9.25 : 6.22195556640625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(7 : 8.25); (7.875 : 8.125); (7.875 : 8.05644744428109); (8.875 : 8.05644744428109); (8.875 : 8.25160970052083); (9.25 : 7.87660970052083)]" manuallyRouted="true" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
       <nodes>
@@ -163,5 +163,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(9.5 : 3.67470540364583); (9.5 : 4.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(10.3125 : 3.67470540364583); (10.3125 : 4.375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Slave/Slave_Job" />
       <nodes>
@@ -170,5 +170,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(12.375 : 3.99924967447917); (11.46875 : 3.99924967447917); (11.46875 : 9.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(12.21875 : 2.1362939453125); (12.21875 : 4.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" />
       <nodes>
@@ -177,9 +177,35 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(9.40625 : 8.0689111328125); (9.40625 : 11.8902498372396); (8.48958333333333 : 11.8902498372396 : JumpStart); (8.32291666666667 : 11.8902498372396 : JumpEnd); (8 : 11.8902498372396)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(9.25 : 6.71875); (6.875 : 6.71875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_HiveExperiment" />
       <nodes>
         <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
         <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" />
+      </nodes>
+    </associationConnector>
+    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="6.875, 4.375, 2, 1.1939925130208327">
+      <DataClassMoniker Name="/HiveDataContext/JobData" />
+      <nestedChildShapes>
+        <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="6.89, 4.835, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.5, 10.625, 2, 1.1939925130208344">
+      <DataClassMoniker Name="/HiveDataContext/PluginData" />
+      <nestedChildShapes>
+        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.515, 11.085, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
+      <nodes>
+        <classShapeMoniker Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" />
+        <classShapeMoniker Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(9.25 : 4.97199625651042); (8.875 : 4.97199625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
+      <nodes>
+        <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />
+        <classShapeMoniker Id="6bc13f26-f9a8-4597-b054-35be34190d12" />
       </nodes>
     </associationConnector>
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 4598)
@@ -43,7 +43,7 @@
     partial void UpdateSlaveGroup_Resource(SlaveGroup_Resource instance);
     partial void DeleteSlaveGroup_Resource(SlaveGroup_Resource instance);
-    partial void InsertPluginInfo(PluginInfo instance);
-    partial void UpdatePluginInfo(PluginInfo instance);
-    partial void DeletePluginInfo(PluginInfo instance);
+    partial void InsertPlugin(Plugin instance);
+    partial void UpdatePlugin(Plugin instance);
+    partial void DeletePlugin(Plugin instance);
     partial void InsertProject(Project instance);
     partial void UpdateProject(Project instance);
@@ -64,4 +64,7 @@
     partial void UpdateHiveExperiment(HiveExperiment instance);
     partial void DeleteHiveExperiment(HiveExperiment instance);
+    partial void InsertJobData(JobData instance);
+    partial void UpdateJobData(JobData instance);
+    partial void DeleteJobData(JobData instance);
     #endregion
 		
@@ -122,9 +125,9 @@
 		}
 		
-		public System.Data.Linq.Table<PluginInfo> PluginInfos
-		{
-			get
-			{
-				return this.GetTable<PluginInfo>();
+		public System.Data.Linq.Table<Plugin> Plugins
+		{
+			get
+			{
+				return this.GetTable<Plugin>();
 			}
 		}
@@ -175,4 +178,20 @@
 			{
 				return this.GetTable<HiveExperiment>();
+			}
+		}
+		
+		public System.Data.Linq.Table<JobData> JobDatas
+		{
+			get
+			{
+				return this.GetTable<JobData>();
+			}
+		}
+		
+		public System.Data.Linq.Table<PluginData> PluginDatas
+		{
+			get
+			{
+				return this.GetTable<PluginData>();
 			}
 		}
@@ -876,6 +895,6 @@
 	}
 	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PluginInfo")]
-	public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Plugin")]
+	public partial class Plugin : INotifyPropertyChanging, INotifyPropertyChanged
 	{
 		
@@ -906,5 +925,5 @@
     #endregion
 		
-		public PluginInfo()
+		public Plugin()
 		{
 			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
@@ -1028,5 +1047,5 @@
 		{
 			this.SendPropertyChanging();
-			entity.PluginInfo = this;
+			entity.Plugin = this;
 		}
 		
@@ -1034,5 +1053,5 @@
 		{
 			this.SendPropertyChanging();
-			entity.PluginInfo = null;
+			entity.Plugin = null;
 		}
 	}
@@ -1164,5 +1183,5 @@
 		private System.Guid _PluginId;
 		
-		private EntityRef<PluginInfo> _PluginInfo;
+		private EntityRef<Plugin> _PluginInfo;
 		
 		private EntityRef<Job> _Job;
@@ -1182,5 +1201,5 @@
 		public RequiredPlugin()
 		{
-			this._PluginInfo = default(EntityRef<PluginInfo>);
+			this._PluginInfo = default(EntityRef<Plugin>);
 			this._Job = default(EntityRef<Job>);
 			OnCreated();
@@ -1256,5 +1275,5 @@
 		
 		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")]
-		public PluginInfo PluginInfo
+		public Plugin Plugin
 		{
 			get
@@ -1264,5 +1283,5 @@
 			set
 			{
-				PluginInfo previousValue = this._PluginInfo.Entity;
+				Plugin previousValue = this._PluginInfo.Entity;
 				if (((previousValue != value) 
 							|| (this._PluginInfo.HasLoadedOrAssignedValue == false)))
@@ -1284,5 +1303,5 @@
 						this._PluginId = default(System.Guid);
 					}
-					this.SendPropertyChanged("PluginInfo");
+					this.SendPropertyChanged("Plugin");
 				}
 			}
@@ -1978,6 +1997,4 @@
 		private string _Exception;
 		
-		private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;
-		
 		private System.Nullable<System.DateTime> _DateCreated;
 		
@@ -2001,4 +2018,6 @@
 		
 		private EntitySet<Job> _Jobs;
+		
+		private EntityRef<JobData> _JobData;
 		
 		private EntityRef<Job> _Job1;
@@ -2024,6 +2043,4 @@
     partial void OnExceptionChanging(string value);
     partial void OnExceptionChanged();
-    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
-    partial void OnSerializedJobChanged();
     partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
     partial void OnDateCreatedChanged();
@@ -2049,4 +2066,5 @@
 			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
 			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._JobData = default(EntityRef<JobData>);
 			this._Job1 = default(EntityRef<Job>);
 			this._Project = default(EntityRef<Project>);
@@ -2183,24 +2201,4 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SerializedJob", DbType="VarBinary(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
-		public System.Data.Linq.Binary SerializedJob
-		{
-			get
-			{
-				return this._SerializedJob.Value;
-			}
-			set
-			{
-				if ((this._SerializedJob.Value != value))
-				{
-					this.OnSerializedJobChanging(value);
-					this.SendPropertyChanging();
-					this._SerializedJob.Value = value;
-					this.SendPropertyChanged("SerializedJob");
-					this.OnSerializedJobChanged();
-				}
-			}
-		}
-		
 		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime")]
 		public System.Nullable<System.DateTime> DateCreated
@@ -2403,4 +2401,33 @@
 			{
 				this._Jobs.Assign(value);
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobData", Storage="_JobData", ThisKey="JobId", OtherKey="JobId", IsUnique=true, IsForeignKey=false)]
+		public JobData JobData
+		{
+			get
+			{
+				return this._JobData.Entity;
+			}
+			set
+			{
+				JobData previousValue = this._JobData.Entity;
+				if (((previousValue != value) 
+							|| (this._JobData.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._JobData.Entity = null;
+						previousValue.Job = null;
+					}
+					this._JobData.Entity = value;
+					if ((value != null))
+					{
+						value.Job = this;
+					}
+					this.SendPropertyChanged("JobData");
+				}
 			}
 		}
@@ -3018,4 +3045,176 @@
 		}
 	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class JobData : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _JobId;
+		
+		private System.Data.Linq.Binary _Data;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnDataChanging(System.Data.Linq.Binary value);
+    partial void OnDataChanged();
+    #endregion
+		
+		public JobData()
+		{
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="VarBinary(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		public System.Data.Linq.Binary Data
+		{
+			get
+			{
+				return this._Data;
+			}
+			set
+			{
+				if ((this._Data != value))
+				{
+					this.OnDataChanging(value);
+					this.SendPropertyChanging();
+					this._Data = value;
+					this.SendPropertyChanged("Data");
+					this.OnDataChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_JobData", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.JobData = null;
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.JobData = this;
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[global::System.Data.Linq.Mapping.TableAttribute(Name="")]
+	public partial class PluginData
+	{
+		
+		private System.Guid _PluginId;
+		
+		private System.Data.Linq.Binary _Data;
+		
+		public PluginData()
+		{
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid PluginId
+		{
+			get
+			{
+				return this._PluginId;
+			}
+			set
+			{
+				if ((this._PluginId != value))
+				{
+					this._PluginId = value;
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Data", DbType="VarBinary(MAX) NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		public System.Data.Linq.Binary Data
+		{
+			get
+			{
+				return this._Data;
+			}
+			set
+			{
+				if ((this._Data != value))
+				{
+					this._Data = value;
+				}
+			}
+		}
+	}
 }
 #pragma warning restore 1591
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IContextFactory.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IContextFactory.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IContextFactory.cs	(revision 4598)
@@ -24,5 +24,5 @@
 
 namespace HeuristicLab.Services.Hive.DataAccess {
-  public interface IContextFactory {
+  public interface IContextFactory<T> where T : DataContext {
     /// <summary>
     /// Uses transaction by default.
@@ -34,5 +34,5 @@
     IDisposable GetContext(bool withTransaction);
 
-    DataContext CurrentContext { get; }
+    T CurrentContext { get; }
 
     void RollbackTransaction();
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs	(revision 4598)
@@ -0,0 +1,72 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Linq.Expressions;
+
+namespace HeuristicLab.Services.Hive.DataAccess {
+  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
+
+  public interface IHiveDao {
+    #region Job Methods
+    DT.Job GetJob(Guid id);
+    IEnumerable<DT.Job> GetJobs(Expression<Func<Job, bool>> predicate);
+    Guid AddJob(DT.Job dto);
+    void UpdateJob(DT.Job dto);
+    void DeleteJob(Guid id);
+    #endregion
+
+    #region JobData Methods
+    DT.JobData GetJobData(Guid id);
+    IEnumerable<DT.JobData> GetJobDatas(Expression<Func<JobData, bool>> predicate);
+    Guid AddJobData(DT.JobData dto);
+    void UpdateJobData(DT.JobData dto);
+    void DeleteJobData(Guid id);
+    #endregion
+
+    #region HiveExperiment Methods
+    DT.HiveExperiment GetHiveExperiment(Guid id);
+    IEnumerable<DT.HiveExperiment> GetHiveExperiments(Expression<Func<HiveExperiment, bool>> predicate);
+    Guid AddHiveExperiment(DT.HiveExperiment dto);
+    void UpdateHiveExperiment(DT.HiveExperiment dto);
+    void DeleteHiveExperiment(Guid id);
+    #endregion
+
+    #region Plugin Methods
+    #endregion
+
+    #region PluginData Methods
+    #endregion
+
+    #region Calendar Methods
+    #endregion
+
+    #region Slave Methods
+    DT.Slave GetSlave(Guid id);
+    IEnumerable<DT.Slave> GetSlaves(Expression<Func<Slave, bool>> predicate);
+    Guid AddSlave(DT.Slave dto);
+    void UpdateSlave(DT.Slave dto);
+    void DeleteSlave(Guid id);
+    #endregion
+
+    #region SlaveGroup Methods
+    DT.SlaveGroup GetSlaveGroup(Guid id);
+    IEnumerable<DT.SlaveGroup> GetSlaveGroups(Expression<Func<SlaveGroup, bool>> predicate);
+    Guid AddSlaveGroup(DT.SlaveGroup dto);
+    void UpdateSlaveGroup(DT.SlaveGroup dto);
+    void DeleteSlaveGroup(Guid id);
+    #endregion
+
+    #region Resource Methods
+    DT.Resource GetResource(Guid id);
+    IEnumerable<DT.Resource> GetResources(Expression<Func<Resource, bool>> predicate);
+    Guid AddResource(DT.Resource dto);
+    void UpdateResource(DT.Resource dto);
+    void DeleteResource(Guid id);
+    #endregion
+
+    #region Authorization Methods
+    bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds);
+    #endregion
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/AuthorizationManager.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/AuthorizationManager.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/AuthorizationManager.cs	(revision 4598)
@@ -0,0 +1,53 @@
+﻿#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.Linq;
+using System.Security;
+using System.Web.Security;
+
+namespace HeuristicLab.Services.Hive {
+  public class AuthorizationManager : IAuthorizationManager {
+    private MembershipUser Identity {
+      get { return Membership.GetUser(); }
+    }
+
+    public Guid UserId {
+      get { return (Guid)Identity.ProviderUserKey; }
+    }
+
+    public void AuthorizeJobs(params Guid[] jobIds) {
+      if (!IsAuthorizedForJobs(jobIds)) {
+        throw new SecurityException("User '" + Identity.UserName + "' is not authorized to access job (Id: " + string.Join(", ", jobIds.Select(x => x.ToString()).ToArray()) + ")");
+      }
+    }
+    
+    private bool IsAuthorizedForJobs(params Guid[] jobIds) {
+      return ServiceLocator.Instance.HiveDao.IsUserAuthorizedForJobs(UserId, jobIds);
+    }
+
+    public void Authorize(Guid userId) {
+      if (userId != this.UserId) {
+        throw new SecurityException("User '" + Identity.UserName + "' is not authorized to access object");
+      }
+    }
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Convert.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Convert.cs	(revision 4595)
+++ 	(revision )
@@ -1,52 +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.Collections.Generic;
-using System.Data.Linq;
-using System.Linq;
-using DA = HeuristicLab.Services.Hive.DataAccess;
-using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
-
-namespace HeuristicLab.Services.OKB {
-  public static class Convert {
-
-   
-    #region Job
-    public static DT.Job ToDto(DA.Job source) {
-      if (source == null) return null;
-      return new DT.Job { Id = source.JobId };
-    }
-    public static DA.Job ToEntity(DT.Job source) {
-      if (source == null) return null;
-      return new DA.Job { JobId = source.Id };
-    }
-    public static void ToEntity(DT.Job source, DA.Job target) {
-      if ((source != null) && (target != null)) {
-        target.JobId = source.Id;
-      }
-    }
-    #endregion
-
-
-
-   
-  }
-}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HeuristicLab.Services.Hive-3.3.csproj
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HeuristicLab.Services.Hive-3.3.csproj	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HeuristicLab.Services.Hive-3.3.csproj	(revision 4598)
@@ -44,7 +44,11 @@
       <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.Tracing-3.3, Version=3.2.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Data.Linq" />
     <Reference Include="System.ServiceModel" />
+    <Reference Include="System.Transactions" />
+    <Reference Include="System.Web" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
@@ -53,9 +57,13 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Convert.cs" />
+    <Compile Include="AuthorizationManager.cs" />
     <Compile Include="HeuristicLabServicesHivePlugin.cs" />
+    <Compile Include="Hive.cs" />
     <Compile Include="HiveRoles.cs" />
     <Compile Include="HiveService.cs" />
+    <Compile Include="Interfaces\IAuthorizationManager.cs" />
+    <Compile Include="LifecycleManager.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ServiceLocator.cs" />
   </ItemGroup>
   <ItemGroup>
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Hive.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Hive.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Hive.cs	(revision 4598)
@@ -0,0 +1,81 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Transactions;
+using HeuristicLab.Services.Hive.Common;
+using HeuristicLab.Services.Hive.Common.DataTransfer;
+
+namespace HeuristicLab.Services.Hive {
+  public class Hive {
+    private static object locker = new object();
+    private Dictionary<Guid, DateTime> heartbeats = new Dictionary<Guid, DateTime>();
+
+    /// <summary>
+    /// Contains a list job JobIds which have been sent to a slave, but the slave has not yet sent 
+    /// a jobProgress of the job with a heartbeat, because he has not finished downloading/deserializing it.
+    /// The number value indicates a TimeToLive count that is decremented with each server-heartbeat.
+    /// When the number reaches zero, the jobs is assumed to be lost and is set Offline again.
+    /// </summary>
+    private Dictionary<Guid, int> newAssignedJobs = new Dictionary<Guid, int>();
+
+    private LifecycleManager lifecycleManager;
+
+    private DataAccess.IHiveDao dao { 
+      get { return ServiceLocator.Instance.HiveDao; } 
+    }
+    private DataAccess.IContextFactory<DataAccess.HiveDataContext> contextFactory { 
+      get { return ServiceLocator.Instance.ContextFactory; } 
+    }
+    private IAuthorizationManager auth {
+      get { return ServiceLocator.Instance.AuthorizationManager; }
+    }
+
+    public Hive() {
+      this.lifecycleManager = new LifecycleManager();
+      lifecycleManager.ServerHeartbeat += new EventHandler(lifecycleManager_ServerHeartbeat);
+    }
+
+    /// <summary>
+    /// Check if online slaves send their hearbeats
+    /// if not -> set them offline and check if they where calculating a job
+    /// </summary>
+    void lifecycleManager_ServerHeartbeat(object sender, EventArgs e) {
+      lock (locker) {
+        Guid[] slaveIds = dao.GetSlaves(x => true).Select(s => s.Id).ToArray();
+
+        foreach (Guid slaveId in slaveIds) {
+          if (!heartbeats.ContainsKey(slaveId)) {
+            // add a heartbeat NOW and give the slave time to say something for some time (HEARTBEAT_MAX_DIF)
+            // otherwise alls the slaves jobs would be aborted, which is not desirable if the server has just been restarted
+            heartbeats.Add(slaveId, DateTime.Now);
+          } else {
+            CheckTimeouts(slaveId);
+          }
+        }
+      }
+    }
+
+    private void CheckTimeouts(Guid slaveId) {
+      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
+        TimeSpan timeSinceLastHeartbeat = DateTime.Now - heartbeats[slaveId];
+        if (timeSinceLastHeartbeat.TotalSeconds > ApplicationConstants.HEARTBEAT_TIMEOUT) {
+          // slave timed out
+          var jobs = dao.GetJobs(x => x.Slave.ResourceId == slaveId);
+          foreach (var j in jobs) {
+            j.State = JobState.Waiting;
+            dao.UpdateJob(j);
+          }
+          var slave = dao.GetSlave(slaveId);
+          if (slave.State != SlaveState.Offline) {
+            slave.State = SlaveState.Offline;
+            dao.UpdateSlave(slave);
+          }
+          heartbeats.Remove(slaveId);
+        }
+        scope.Complete();
+      }
+    }
+
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HiveRoles.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HiveRoles.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HiveRoles.cs	(revision 4598)
@@ -21,5 +21,5 @@
 
 
-namespace HeuristicLab.Hive.Contracts {
+namespace HeuristicLab.Services.Hive {
   public static class HiveRoles {
     public const string Administrator = "Hive.Administrator";
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HiveService.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HiveService.cs	(revision 4595)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/HiveService.cs	(revision 4598)
@@ -9,6 +9,9 @@
 using System.IO;
 using System.Security.Permissions;
+using System.Data.Linq;
 
 namespace HeuristicLab.Services.Hive {
+
+
   /// <summary>
   /// Implementation of the Hive service (interface <see cref="IHiveService"/>).
@@ -16,103 +19,127 @@
   [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
   public class HiveService : IHiveService {
-    private DataAccess.IContextFactory contextFactory = new DataAccess.ContextFactory();
+    private DataAccess.IHiveDao dao { 
+      get { return ServiceLocator.Instance.HiveDao; } 
+    }
+    private DataAccess.IContextFactory<DataAccess.HiveDataContext> contextFactory { 
+      get { return ServiceLocator.Instance.ContextFactory; } 
+    }
+    private IAuthorizationManager auth {
+      get { return ServiceLocator.Instance.AuthorizationManager; }
+    }
 
     #region Job Methods
     [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
     [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)]
-    public Guid AddJob(JobData dto) {
-      using (contextFactory.GetContext()) {
-        DataAccess.Job entity = Convert.ToEntity(dto); entity.Id = 0;
-        okb.Platforms.InsertOnSubmit(entity);
-        okb.SubmitChanges();
-        return entity.Id;
-      }
-    }
-
-    public Job AddJobWithGroupStrings(JobData jobObj, IEnumerable<string> groups) {
-      throw new NotImplementedException();
-    }
-
-    public JobData GetLastSerializedResult(Guid jobId) {
-      throw new NotImplementedException();
-    }
-
+    public Guid AddJob(Job jobDto, JobData jobDataDto) {
+      using (contextFactory.GetContext()) {
+        jobDataDto.JobId = dao.AddJob(jobDto);
+        dao.AddJobData(jobDataDto);
+        return jobDataDto.JobId;
+      }
+    }
+
+    public Guid AddChildJob(Guid parentJobId, Job jobDto, JobData jobDataDto) {
+      jobDto.ParentJobId = parentJobId;
+      return AddJob(jobDto, jobDataDto);
+    }
+
+    public Job GetJob(Guid jobId) {
+      using (contextFactory.GetContext()) {
+        return dao.GetJob(jobId);
+      }
+    }
+
+    public IEnumerable<Job> GetJobs() {
+      using (contextFactory.GetContext()) {
+        return dao.GetJobs(x => true);
+      }
+    }
+
+    public IEnumerable<LightweightJob> GetLightweightJobs(IEnumerable<Guid> jobIds) {
+      using (contextFactory.GetContext()) {
+        return dao.GetJobs(x => jobIds.Contains(x.JobId)).Select(x => new LightweightJob(x)).ToArray();
+      }
+    }
+
+    public IEnumerable<LightweightJob> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent) {
+      using (contextFactory.GetContext()) {
+        return GetChildJobs(parentJobId, recursive, includeParent).Select(x => new LightweightJob(x)).ToArray();
+      }
+    }
+
+    // formerly GetLastSerializedResult
+    public JobData GetJobData(Guid jobId) {
+      using (contextFactory.GetContext()) {
+        return dao.GetJobData(jobId);
+      }
+    }
+
+    public Stream GetJobDataStreamed(Guid jobId) {
+      throw new NotImplementedException();
+    }
+
+    public void UpdateJob(Job jobDto, JobData jobDataDto) {
+      using (contextFactory.GetContext()) {
+        dao.UpdateJob(jobDto);
+        dao.UpdateJobData(jobDataDto);
+      }
+    }
+
+    public void UpdateJobDataStreamed(Stream stream) {
+      throw new NotImplementedException();
+    }
+
+    public void DeleteChildJobs(Guid jobId) {
+      using (contextFactory.GetContext()) {
+        var jobs = GetChildJobs(jobId, true, false);
+        foreach (var job in jobs) {
+          dao.DeleteJob(job.Id);
+          dao.DeleteJobData(job.Id);
+        };
+      }
+    }
+
+    public Job AquireJob(Guid slaveId) {
+      throw new NotImplementedException();
+    }
+    #endregion
+
+
+    #region Job Control Methods
     public void AbortJob(Guid jobId) {
       throw new NotImplementedException();
     }
-
-    public Job GetJobById(Guid jobId) {
-      throw new NotImplementedException();
-    }
-
-    public IEnumerable<LightweightJob> GetJobResults(IEnumerable<Guid> jobIds) {
-      throw new NotImplementedException();
-    }
-
-    public IEnumerable<LightweightJob> GetChildJobResults(Guid? parentJobId, bool recursive, bool includeParent) {
-      throw new NotImplementedException();
-    }
-
-    public Job AddChildJob(Guid parentJobId, JobData serializedJob) {
-      throw new NotImplementedException();
-    }
-
-    public Job GetAllJobsWithFilter(JobState jobState, int offset, int count) {
-      throw new NotImplementedException();
-    }
-
-    public Job GetAllJobs() {
-      throw new NotImplementedException();
-    }
-
-    public Job GetJobByIdWithDetails(Guid jobId) {
-      throw new NotImplementedException();
-    }
-
-    public Job AddNewJob(JobData job) {
-      throw new NotImplementedException();
-    }
-
     public Job PauseJob(JobData serializedJob) {
       throw new NotImplementedException();
     }
-
-    public void DeleteChildJobs(Guid jobId) {
-      throw new NotImplementedException();
-    }
-
-    public Job GetJob(Guid clientId) {
-      throw new NotImplementedException();
-    }
-
-    public void StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception) {
-      throw new NotImplementedException();
-    }
-
-    public void IsJobStillNeeded(Guid jobId) {
-      throw new NotImplementedException();
-    }
-
-    public Stream GetStreamedJob(Guid clientId) {
-      throw new NotImplementedException();
-    }
-
-    public void StoreFinishedJobResultStreamed(Stream stream) {
-      throw new NotImplementedException();
-    }
-
-    #endregion
+    #endregion
+
 
     #region HiveExperiment Methods
     public IEnumerable<HiveExperiment> GetHiveExperiments() {
-      throw new NotImplementedException();
-    }
-
-    public HiveExperiment UpdateHiveExperiment(HiveExperiment hiveExperimentDto) {
-      throw new NotImplementedException();
+      using (contextFactory.GetContext()) {
+        return dao.GetHiveExperiments(x => x.UserId == auth.UserId);
+      }
+    }
+
+    public void UpdateHiveExperiment(HiveExperiment hiveExperimentDto) {
+      using (contextFactory.GetContext()) {
+        dao.UpdateHiveExperiment(hiveExperimentDto);
+      }
     }
 
     public void DeleteHiveExperiment(Guid hiveExperimentId) {
-      throw new NotImplementedException();
+      using (contextFactory.GetContext()) {
+        HiveExperiment he = dao.GetHiveExperiment(hiveExperimentId);
+        if(he.RootJobId.HasValue) {
+          var jobs = GetChildJobs(he.RootJobId.Value, true, true);
+          foreach(var j in jobs) {
+            dao.DeleteJobData(j.Id);
+            dao.DeleteJob(j.Id);
+          }
+        }
+        dao.DeleteHiveExperiment(hiveExperimentId);
+      }
     }
     #endregion
@@ -189,32 +216,60 @@
 
     #region Slave Methods
-    public IEnumerable<Slave> GetAllSlaves() {
-      throw new NotImplementedException();
-    }
-
-    public IEnumerable<SlaveGroup> GetAllSlaveGroups() {
-      throw new NotImplementedException();
-    }
-
-    public IEnumerable<SlaveGroup> GetAllGroupsOfResource(Guid resourceId) {
-      throw new NotImplementedException();
-    }
-
-    public SlaveGroup AddSlaveGroup(SlaveGroup clientGroup) {
-      throw new NotImplementedException();
-    }
-
-    public void DeleteSlaveGroup(Guid clientGroupId) {
-      throw new NotImplementedException();
-    }
-
-    public void AddResourceToGroup(Guid clientGroupId, Resource resource) {
-      throw new NotImplementedException();
-    }
-
-    public void DeleteResourceFromGroup(Guid clientGroupId, Guid resourceId) {
-      throw new NotImplementedException();
-    }
-    #endregion
+    public Guid AddSlaveGroup(SlaveGroup slaveGroup) {
+      using (contextFactory.GetContext()) {
+        return dao.AddSlaveGroup(slaveGroup);
+      }
+    }
+
+    public IEnumerable<Slave> GetSlaves() {
+      using (contextFactory.GetContext()) {
+        return dao.GetSlaves(x => true);
+      }
+    }
+
+    public IEnumerable<SlaveGroup> GetSlaveGroups() {
+      using (contextFactory.GetContext()) {
+        return dao.GetSlaveGroups(x => true);
+      }
+    }
+    
+    public void DeleteSlaveGroup(Guid slaveGroupId) {
+      using (contextFactory.GetContext()) {
+        dao.DeleteSlaveGroup(slaveGroupId);
+      }
+    }
+
+    public void AddResourceToGroup(Guid slaveGroupId, Resource resource) {
+      using (contextFactory.GetContext()) {
+        throw new NotImplementedException();        
+      }
+    }
+
+    public void RemoveResourceFromGroup(Guid clientGroupId, Guid resourceId) {
+      using (contextFactory.GetContext()) {
+        throw new NotImplementedException();
+      }
+    }
+    #endregion
+
+    #region Helper Methods
+    private IEnumerable<Job> GetChildJobs(Guid? parentJobId, bool recursive, bool includeParent) {
+      var jobs = new List<Job>(dao.GetJobs(x => parentJobId == null ? !x.ParentJobId.HasValue : x.ParentJobId.Value == parentJobId));
+
+      if (includeParent) {
+        jobs.Add(GetJob(parentJobId.Value));
+      }
+
+      if (recursive) {
+        var childs = new List<Job>();
+        foreach (var job in jobs) {
+          childs.AddRange(GetChildJobs(job.Id, recursive, false));
+        }
+        jobs.AddRange(childs);
+      }
+      return jobs;
+    }
+    #endregion
+
 
   }
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Interfaces/IAuthorizationManager.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Interfaces/IAuthorizationManager.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/Interfaces/IAuthorizationManager.cs	(revision 4598)
@@ -0,0 +1,42 @@
+﻿#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;
+namespace HeuristicLab.Services.Hive {
+  public interface IAuthorizationManager {
+    /// <summary>
+    /// Returns the UserId of the currently authenticated user
+    /// </summary>
+    Guid UserId { get; }
+
+    /// <summary>
+    /// Checks if the user is allowed to access all the jobs.
+    /// throws an exception if one of those jobs is inaccessible
+    /// </summary>
+    /// <exception cref="SecurityException">thrown when access denied</exception>
+    void AuthorizeJobs(params Guid[] jobId);
+
+    /// <summary>
+    /// Compares the current UserId with the given userId and takes appropriate actions if the mismatch
+    /// </summary>
+    void Authorize(Guid userId);
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/LifecycleManager.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/LifecycleManager.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/LifecycleManager.cs	(revision 4598)
@@ -0,0 +1,97 @@
+﻿#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.Threading;
+using HeuristicLab.Tracing;
+
+namespace HeuristicLab.Services.Hive {
+  class LifecycleManager {
+    private AutoResetEvent waitHandle;
+    private Thread thread;
+    private bool shutdownRequested;
+
+    private TimeSpan interval = new TimeSpan(0, 0, 10);
+    public TimeSpan Interval {
+      get { return interval; }
+      set { interval = value; }
+    }
+
+    private int jobsCurrentlyTransfering = 0;
+    public int JobsCurrentlyTransferring {
+      get { return jobsCurrentlyTransfering; }
+      set {
+        if (jobsCurrentlyTransfering != value) {
+          jobsCurrentlyTransfering = value;
+          Logger.Info("JobsCurrentlyTransfering: " + jobsCurrentlyTransfering);
+        }
+      }
+    }
+
+    public void Start() {
+      Thread thread = new Thread(RunHeartbeatThread);
+      thread.Start();
+      using (ServiceLocator.Instance.ContextFactory.GetContext()) {
+        OnStarted();
+      }
+    }
+
+    private void RunHeartbeatThread() {
+      waitHandle = new AutoResetEvent(false);
+      shutdownRequested = false;
+      while (!shutdownRequested) {
+        using (ServiceLocator.Instance.ContextFactory.GetContext(false)) {
+          OnServerHeartbeat();
+        }
+        waitHandle.WaitOne(this.Interval);
+      }
+      waitHandle.Close();
+      using (ServiceLocator.Instance.ContextFactory.GetContext()) {
+        OnStopped();
+      }
+    }
+
+    public void Stop() {
+      shutdownRequested = true;
+      if (waitHandle != null) waitHandle.Set();
+      if (thread != null) thread.Join();
+      thread = null;
+    }
+
+    public event EventHandler ServerHeartbeat;
+    private void OnServerHeartbeat() {
+      var handler = ServerHeartbeat;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler Started;
+    private void OnStarted() {
+      var handler = Started;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler Stopped;
+    private void OnStopped() {
+      var handler = Stopped;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+  }
+}
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/ServiceLocator.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/ServiceLocator.cs	(revision 4598)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.Server/3.3/ServiceLocator.cs	(revision 4598)
@@ -0,0 +1,44 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Services.Hive.DataAccess;
+
+namespace HeuristicLab.Services.Hive {
+
+  public class ServiceLocator {
+    private static CreateDataContext<HiveDataContext> contextCreator = new CreateDataContext<HiveDataContext>(ContextFactory<HiveDataContext>.CreateHiveContext);
+
+    private static ServiceLocator instance;
+    public static ServiceLocator Instance {
+      get {
+        if (instance == null) instance = new ServiceLocator();
+        return instance;
+      }
+    }
+
+    private IHiveDao hiveDao;
+    public IHiveDao HiveDao {
+      get {
+        if (hiveDao == null) hiveDao = new HiveDao(ContextFactory);
+        return hiveDao;
+      }
+    }
+
+    private IContextFactory<HiveDataContext> contextFactory;
+    public IContextFactory<HiveDataContext> ContextFactory {
+      get {
+        if(contextFactory == null) contextFactory = new ContextFactory<HiveDataContext>(contextCreator);
+        return contextFactory;
+      }
+    }
+
+    private IAuthorizationManager authorizationManager;
+    public IAuthorizationManager AuthorizationManager {
+      get {
+        if (authorizationManager == null) authorizationManager = new AuthorizationManager();
+        return authorizationManager;
+      }
+    }
+  }
+}
