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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Convert.cs	(revision 4905)
@@ -45,5 +45,6 @@
         SlaveId = source.SlaveId,
         JobState = source.JobState,
-        UserId = source.UserId
+        UserId = source.UserId,
+        PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList()
       };
     }
@@ -69,4 +70,5 @@
         target.JobState = source.JobState;
         target.UserId = source.UserId;
+//        target.RequiredPlugins = db.Plugins.Select(x => source.PluginsNeededIds.Contains(x.PluginId)); - this is difficult
       }
     }
@@ -107,4 +109,38 @@
     #endregion
 
+    #region Plugin
+    public static DT.Plugin ToDto(Plugin source) {
+      if (source == null) return null;
+      return new DT.Plugin { Id = source.PluginId, Name = source.Name, Version = new Version(source.Version) };
+    }
+    public static Plugin ToEntity(DT.Plugin source) {
+      if (source == null) return null;
+      var entity = new Plugin(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.Plugin source, Plugin target) {
+      if ((source != null) && (target != null)) {
+        target.PluginId = source.Id; target.Name = source.Name; target.Version = source.Version.ToString();
+      }
+    }
+    #endregion
+
+    #region PluginData
+    public static DT.PluginData ToDto(PluginData source) {
+      if (source == null) return null;
+      return new DT.PluginData { PluginId = source.PluginId, Data = source.Data.ToArray() };
+    }
+    public static PluginData ToEntity(DT.PluginData source) {
+      if (source == null) return null;
+      var entity = new PluginData(); ToEntity(source, entity);
+      return entity;
+    }
+    public static void ToEntity(DT.PluginData source, PluginData target) {
+      if ((source != null) && (target != null)) {
+        target.PluginId = source.PluginId; target.Data = new Binary(source.Data);
+      }
+    }
+    #endregion
+
     #region Slave
     public static DT.Slave ToDto(Slave source) {
@@ -137,5 +173,5 @@
       if ((source != null) && (target != null)) {
         target.ResourceId = source.Id;
-        target.Name = source.Name; 
+        target.Name = source.Name;
         //target.SlaveGroup_Resources_Children = // TODO: see how working with groups will work, then decide how to handle enumerations in here
         //target.SlaveGroup_Resources_Parents = 
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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 4905)
@@ -50,5 +50,8 @@
       <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="HeuristicLab.Tracing-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Tracing-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs	(revision 4905)
@@ -11,5 +11,5 @@
 
   public class HiveDao : IHiveDao {
-    public HiveDataContext CreateContext() {
+    public static HiveDataContext CreateContext() {
       return new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
     }
@@ -74,5 +74,5 @@
     }
 
-    public IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave) {
+    public IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave) {
       using (var db = CreateContext()) {
         var query = from j in db.Jobs
@@ -166,4 +166,85 @@
     #endregion
 
+    #region Plugin Methods
+    public DT.Plugin GetPlugin(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.Plugins.SingleOrDefault(x => x.PluginId == id));
+      }
+    }
+
+    public IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.Plugins.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddPlugin(DT.Plugin dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.Plugins.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.PluginId;
+      }
+    }
+
+    public void UpdatePlugin(DT.Plugin dto) {
+      using (var db = CreateContext()) {
+        var entity = db.Plugins.FirstOrDefault(x => x.PluginId == dto.Id);
+        if (entity == null) db.Plugins.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeletePlugin(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.Plugins.FirstOrDefault(x => x.PluginId == id);
+        if (entity != null) db.Plugins.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
+    #region PluginData Methods
+
+    public DT.PluginData GetPluginData(Guid id) {
+      using (var db = CreateContext()) {
+        return Convert.ToDto(db.PluginDatas.SingleOrDefault(x => x.PluginId == id));
+      }
+    }
+
+    public IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate) {
+      using (var db = CreateContext()) {
+        return db.PluginDatas.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
+      }
+    }
+
+    public Guid AddPluginData(DT.PluginData dto) {
+      using (var db = CreateContext()) {
+        var entity = Convert.ToEntity(dto);
+        db.PluginDatas.InsertOnSubmit(entity);
+        db.SubmitChanges();
+        return entity.PluginId;
+      }
+    }
+
+    public void UpdatePluginData(DT.PluginData dto) {
+      using (var db = CreateContext()) {
+        var entity = db.PluginDatas.FirstOrDefault(x => x.PluginId == dto.PluginId);
+        if (entity == null) db.PluginDatas.InsertOnSubmit(Convert.ToEntity(dto));
+        else Convert.ToEntity(dto, entity);
+        db.SubmitChanges();
+      }
+    }
+
+    public void DeletePluginData(Guid id) {
+      using (var db = CreateContext()) {
+        var entity = db.PluginDatas.FirstOrDefault(x => x.PluginId == id); // check if all the byte[] is loaded into memory here. otherwise work around to delete without loading it
+        if (entity != null) db.PluginDatas.DeleteOnSubmit(entity);
+        db.SubmitChanges();
+      }
+    }
+    #endregion
+
     #region Slave Methods
     public DT.Slave GetSlave(Guid id) {
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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 4905)
@@ -40,5 +40,4 @@
       <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
       <Column Name="Version" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
-      <Column Name="BuildDate" Type="System.String" DbType="VarChar(20)" CanBeNull="false" />
       <Association Name="Plugin_RequiredPlugin" Member="RequiredPlugins" ThisKey="PluginId" OtherKey="PluginId" Type="RequiredPlugin" />
       <Association Name="Plugin_PluginData" Member="PluginData" ThisKey="PluginId" OtherKey="PluginId" Type="PluginData" Cardinality="One" />
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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 4905)
@@ -1,4 +1,4 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.25, 12.5" name="HiveDataContext">
+<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 17.25, 12.25" name="HiveDataContext">
   <DataContextMoniker Name="/HiveDataContext" />
   <nestedChildShapes>
@@ -27,8 +27,8 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.5785953776041666">
+    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.3862939453125005">
       <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" />
+        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
@@ -189,5 +189,5 @@
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
       <nodes>
@@ -203,5 +203,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
       <nodes>
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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 4905)
@@ -907,6 +907,4 @@
 		private string _Version;
 		
-		private string _BuildDate;
-		
 		private EntitySet<RequiredPlugin> _RequiredPlugins;
 		
@@ -921,6 +919,4 @@
     partial void OnVersionChanging(string value);
     partial void OnVersionChanged();
-    partial void OnBuildDateChanging(string value);
-    partial void OnBuildDateChanged();
     #endregion
 		
@@ -987,24 +983,4 @@
 					this.SendPropertyChanged("Version");
 					this.OnVersionChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BuildDate", DbType="VarChar(20)", CanBeNull=false)]
-		public string BuildDate
-		{
-			get
-			{
-				return this._BuildDate;
-			}
-			set
-			{
-				if ((this._BuildDate != value))
-				{
-					this.OnBuildDateChanging(value);
-					this.SendPropertyChanging();
-					this._BuildDate = value;
-					this.SendPropertyChanged("BuildDate");
-					this.OnBuildDateChanged();
 				}
 			}
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 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs	(revision 4905)
@@ -15,5 +15,5 @@
     void UpdateJob(DT.Job dto);
     void DeleteJob(Guid id);
-    IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave);
+    IEnumerable<DT.Job> GetWaitingJobs(DT.Slave slave);
     #endregion
 
@@ -35,7 +35,17 @@
 
     #region Plugin Methods
+    DT.Plugin GetPlugin(Guid id);
+    IEnumerable<DT.Plugin> GetPlugins(Expression<Func<Plugin, bool>> predicate);
+    Guid AddPlugin(DT.Plugin dto);
+    void UpdatePlugin(DT.Plugin dto);
+    void DeletePlugin(Guid id);
     #endregion
 
     #region PluginData Methods
+    DT.PluginData GetPluginData(Guid id);
+    IEnumerable<DT.PluginData> GetPluginDatas(Expression<Func<PluginData, bool>> predicate);
+    Guid AddPluginData(DT.PluginData dto);
+    void UpdatePluginData(DT.PluginData dto);
+    void DeletePluginData(Guid id);
     #endregion
 
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/CreateHiveDatabaseApplication.cs
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/CreateHiveDatabaseApplication.cs	(revision 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/CreateHiveDatabaseApplication.cs	(revision 4905)
@@ -27,6 +27,5 @@
 
     public override void Run() {
-      var dao = new HiveDao();
-      using (var db = dao.CreateContext()) {
+      using (var db = HiveDao.CreateContext()) {
         if (db.DatabaseExists())
           db.DeleteDatabase();
Index: branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/prepareHiveDatabase.sql
===================================================================
--- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/prepareHiveDatabase.sql	(revision 4796)
+++ branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Tools/prepareHiveDatabase.sql	(revision 4905)
@@ -31,4 +31,16 @@
 ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId ADD ROWGUIDCOL;
 ALTER TABLE dbo.AssignedResources WITH NOCHECK ADD CONSTRAINT [DF_AssignedResources_AssignedRessourcesId] DEFAULT (newid()) FOR AssignedRessourcesId;
+ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Job_AssignedResource]
+ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Job_AssignedResource] FOREIGN KEY([JobId])
+REFERENCES [dbo].[Job] ([JobId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+ALTER TABLE [dbo].[AssignedResources]  DROP  CONSTRAINT [Resource_AssignedResource]
+ALTER TABLE [dbo].[AssignedResources]  WITH CHECK ADD  CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId])
+REFERENCES [dbo].[Resource] ([ResourceId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
 
 ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
@@ -50,4 +62,18 @@
 ALTER TABLE dbo.RequiredPlugins WITH NOCHECK ADD CONSTRAINT [DF_RequiredPlugins_RequiredPluginId] DEFAULT (newid()) FOR RequiredPluginId;
 
+ALTER TABLE [dbo].[RequiredPlugins]  DROP  CONSTRAINT [Job_RequiredPlugin]
+ALTER TABLE [dbo].[RequiredPlugins]  WITH CHECK ADD  CONSTRAINT [Job_RequiredPlugin] FOREIGN KEY([JobId])
+REFERENCES [dbo].[Job] ([JobId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[RequiredPlugins]  DROP  CONSTRAINT [Plugin_RequiredPlugin]
+ALTER TABLE [dbo].[RequiredPlugins]  WITH CHECK ADD  CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY([PluginId])
+REFERENCES [dbo].[Plugin] ([PluginId])
+ON UPDATE CASCADE
+ON DELETE CASCADE
+GO
+
 ALTER TABLE dbo.Resource ALTER COLUMN ResourceId ADD ROWGUIDCOL;
 ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (newid()) FOR ResourceId;
@@ -64,2 +90,51 @@
 /* create indices */
 CREATE INDEX Index_RequiredPlugins_JobId ON RequiredPlugins(JobId);
+
+/* triggers */
+SET ANSI_NULLS ON
+GO
+SET QUOTED_IDENTIFIER ON
+GO
+-- =============================================
+-- Author:		cneumuel
+-- Create date: 11.11.2010
+-- Description:	Deletes the root-job of the experiment when experiment is deleted
+-- =============================================
+CREATE TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] FOR DELETE AS 
+SET NOCOUNT ON
+DELETE Job FROM deleted, Job WHERE Job.JobId = deleted.RootJobId
+GO
+
+SET ANSI_NULLS ON
+GO
+SET QUOTED_IDENTIFIER ON
+GO
+-- =============================================
+-- Author:		cneumuel
+-- Create date: 11.11.2010
+-- Description:	Recursively deletes all child-jobs of a job when it is deleted. (Source: http://devio.wordpress.com/2008/05/23/recursive-delete-in-sql-server/)
+-- =============================================
+CREATE TRIGGER [dbo].[tr_JobDeleteCascade] ON [dbo].[Job] INSTEAD OF DELETE AS 
+BEGIN
+	CREATE TABLE #Table( 
+		JobId uniqueidentifier 
+	)
+	INSERT INTO #Table (JobId)
+	SELECT JobId FROM deleted
+	
+	DECLARE @c INT
+	SET @c = 0
+	
+	WHILE @c <> (SELECT COUNT(JobId) FROM #Table) BEGIN
+		SELECT @c = COUNT(JobId) FROM #Table
+		
+		INSERT INTO #Table (JobId)
+			SELECT Job.JobId
+			FROM Job
+			LEFT OUTER JOIN #Table ON Job.JobId = #Table.JobId
+			WHERE Job.ParentJobId IN (SELECT JobId FROM #Table)
+				AND #Table.JobId IS NULL
+	END
+	
+	DELETE Job FROM Job INNER JOIN #Table ON Job.JobId = #Table.JobId
+END
