Index: /trunk/sources/HeuristicLab.DataAccess.ADOHelper/BinaryRelation.cs
===================================================================
--- /trunk/sources/HeuristicLab.DataAccess.ADOHelper/BinaryRelation.cs	(revision 1515)
+++ /trunk/sources/HeuristicLab.DataAccess.ADOHelper/BinaryRelation.cs	(revision 1515)
@@ -0,0 +1,11 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.DataAccess.ADOHelper {
+  public class BinaryRelation: PersistableObject {
+    public Guid Id2 { get; set; }
+  }
+}
Index: /trunk/sources/HeuristicLab.DataAccess.ADOHelper/BinaryRelationHelper.cs
===================================================================
--- /trunk/sources/HeuristicLab.DataAccess.ADOHelper/BinaryRelationHelper.cs	(revision 1515)
+++ /trunk/sources/HeuristicLab.DataAccess.ADOHelper/BinaryRelationHelper.cs	(revision 1515)
@@ -0,0 +1,93 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.DataAccess.ADOHelper {
+  public class BinaryRelationHelper<AdapterT, RowT>
+    where AdapterT : new()
+    where RowT : System.Data.DataRow
+    {
+    IDataAdapterWrapper<AdapterT, BinaryRelation, RowT> tableAdapterWrapper;
+    
+    public BinaryRelationHelper(
+      IDataAdapterWrapper<AdapterT, BinaryRelation, RowT> tableAdapterWrapper) {
+      this.tableAdapterWrapper = tableAdapterWrapper;
+    }
+
+    public Session Session {
+      set {
+        tableAdapterWrapper.Session = value;
+      }
+    }
+
+    public void UpdateRelationships(Guid objectA, IList<Guid> relationships) {
+      //firstly check for created references
+      IList<Guid> existing =
+        this.GetRelationships(objectA);
+
+      foreach (Guid relationship in relationships) {
+        if (!existing.Contains(relationship)) {
+          BinaryRelation rel = 
+            new BinaryRelation();
+          rel.Id = objectA;
+          rel.Id2 = relationship;
+          
+          RowT inserted = 
+            tableAdapterWrapper.InsertNewRow(rel);
+
+          tableAdapterWrapper.UpdateRow(inserted);
+        }
+      }
+
+      //secondly check for deleted references
+      ICollection<Guid> deleted =
+        new List<Guid>();
+
+      foreach (Guid relationship in existing) {
+        if(!relationships.Contains(relationship)) {
+          deleted.Add(relationship);
+        }
+      }
+
+      foreach (Guid relationship in deleted) {
+        RowT toDelete =
+          FindRow(objectA, relationship);
+        if (toDelete != null) {
+          toDelete.Delete();
+          tableAdapterWrapper.UpdateRow(toDelete);
+        }
+      }
+    }
+
+    public IList<Guid> GetRelationships(Guid objectA) {
+      IList<Guid> result =
+        new List<Guid>();
+
+      IEnumerable<RowT> rows = 
+        tableAdapterWrapper.FindById(objectA);
+
+      foreach(RowT row in rows) {
+        result.Add((Guid)row[1]);
+      }
+
+      return result;
+    }
+
+    private RowT FindRow(Guid objectA, Guid objectB) {
+      IEnumerable<RowT> rows =
+       tableAdapterWrapper.FindById(objectA);
+
+      RowT found = null;
+
+      foreach (RowT row in rows) {
+        if (row[1].Equals(objectB)) {
+          found = row;
+          break;
+        }
+      }
+
+      return found;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.DataAccess.ADOHelper/DataAdapterBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.DataAccess.ADOHelper/DataAdapterBase.cs	(revision 1514)
+++ /trunk/sources/HeuristicLab.DataAccess.ADOHelper/DataAdapterBase.cs	(revision 1515)
@@ -92,4 +92,10 @@
     }
 
+    protected IDataAdapterWrapper<AdapterT, ObjT, RowT> DataAdapterWrapper {
+      get {
+        return dataAdapter;
+      }
+    }
+
     public ISession Session {
       get {
Index: /trunk/sources/HeuristicLab.DataAccess.ADOHelper/HeuristicLab.DataAccess.ADOHelper.csproj
===================================================================
--- /trunk/sources/HeuristicLab.DataAccess.ADOHelper/HeuristicLab.DataAccess.ADOHelper.csproj	(revision 1514)
+++ /trunk/sources/HeuristicLab.DataAccess.ADOHelper/HeuristicLab.DataAccess.ADOHelper.csproj	(revision 1515)
@@ -85,6 +85,6 @@
     <Compile Include="DataAdapterWrapperBase.cs" />
     <Compile Include="IDataAdapterWrapper.cs" />
-    <Compile Include="Relationship.cs" />
-    <Compile Include="RelationshipAdapter.cs" />
+    <Compile Include="BinaryRelation.cs" />
+    <Compile Include="BinaryRelationHelper.cs" />
     <Compile Include="Session.cs" />
     <Compile Include="SessionFactory.cs" />
Index: unk/sources/HeuristicLab.DataAccess.ADOHelper/Relationship.cs
===================================================================
--- /trunk/sources/HeuristicLab.DataAccess.ADOHelper/Relationship.cs	(revision 1514)
+++ 	(revision )
@@ -1,11 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.DataAccess.Interfaces;
-
-namespace HeuristicLab.DataAccess.ADOHelper {
-  public class Relationship: PersistableObject {
-    public Guid Id2 { get; set; }
-  }
-}
Index: unk/sources/HeuristicLab.DataAccess.ADOHelper/RelationshipAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.DataAccess.ADOHelper/RelationshipAdapter.cs	(revision 1514)
+++ 	(revision )
@@ -1,72 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace HeuristicLab.DataAccess.ADOHelper {
-  public class RelationshipAdapter<AdapterT, RowT>
-    where AdapterT : new()
-    where RowT : System.Data.DataRow
-    {
-    IDataAdapterWrapper<AdapterT, Relationship, RowT> tableAdapterWrapper;
-    
-    public RelationshipAdapter(
-      IDataAdapterWrapper<AdapterT, Relationship, RowT> tableAdapterWrapper) {
-      this.tableAdapterWrapper = tableAdapterWrapper;
-    }
-    
-    public void UpdateRelationships(Guid objectA, IList<Guid> relationships) {
-      //first check for created references
-      IList<Guid> existing =
-        this.GetRelationships(objectA);
-
-      foreach (Guid relationship in relationships) {
-        if (!existing.Contains(relationship)) {
-          Relationship rel = 
-            new Relationship();
-          rel.Id = objectA;
-          rel.Id2 = relationship;
-          
-          RowT inserted = 
-            tableAdapterWrapper.InsertNewRow(rel);
-
-          tableAdapterWrapper.UpdateRow(inserted);
-        }
-      }
-
-      //secondly check for deleted references
-      ICollection<Guid> deleted =
-        new List<Guid>();
-
-      foreach (Guid relationship in existing) {
-        if(!relationships.Contains(relationship)) {
-          deleted.Add(relationship);
-        }
-      }
-
-      foreach (Guid relationship in deleted) {
-        
-      }
-    }
-
-    public IList<Guid> GetRelationships(Guid objectA) {
-      IList<Guid> result =
-        new List<Guid>();
-
-      IEnumerable<RowT> rows = 
-        tableAdapterWrapper.FindById(objectA);
-
-      foreach(RowT row in rows) {
-        result.Add((Guid)row[1]);
-      }
-
-      return result;
-    }
-
-    public Session Session {
-      set {
-        tableAdapterWrapper.Session = value;
-      }
-    }
-  }
-}
Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs	(revision 1515)
@@ -233,11 +233,4 @@
 
         if (row != null) {
-          //Referential integrity with jobs - they are cached
-          ICollection<Job> jobs =
-            JobAdapter.GetJobsOf(client);
-          foreach (Job job in jobs) {
-            JobAdapter.Delete(job);
-          }
-
           success = base.doDelete(client) && 
             ResAdapter.Delete(client);
Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientGroupAdapter.cs	(revision 1515)
@@ -77,4 +77,49 @@
     }
   }
+
+  class ClientGroup_ResourceAdapterWrapper :
+  DataAdapterWrapperBase<dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter,
+  BinaryRelation,
+  dsHiveServer.ClientGroup_ResourceRow> {
+    public override dsHiveServer.ClientGroup_ResourceRow
+     InsertNewRow(BinaryRelation relation) {
+      dsHiveServer.ClientGroup_ResourceDataTable data =
+         new dsHiveServer.ClientGroup_ResourceDataTable();
+
+      dsHiveServer.ClientGroup_ResourceRow row =
+        data.NewClientGroup_ResourceRow();
+
+      row.ClientGroupId = relation.Id;
+      row.ResourceId = relation.Id2;
+
+      data.AddClientGroup_ResourceRow(row);
+      TransactionalAdapter.Update(row);
+
+      return row;
+    }
+
+    public override void
+      UpdateRow(dsHiveServer.ClientGroup_ResourceRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override IEnumerable<dsHiveServer.ClientGroup_ResourceRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataByClientGroupId(id);
+    }
+
+    public override IEnumerable<dsHiveServer.ClientGroup_ResourceRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
   
   class ClientGroupAdapter : 
@@ -84,6 +129,22 @@
     IClientGroupAdapter {
     #region Fields
-    private dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter resourceClientGroupAdapter =
-      new dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter();
+    private BinaryRelationHelper<
+      dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter, 
+      dsHiveServer.ClientGroup_ResourceRow> binaryRelationHelper = null;
+
+    private BinaryRelationHelper<dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter, 
+      dsHiveServer.ClientGroup_ResourceRow> BinaryRelationHelper {
+      get {
+        if (binaryRelationHelper == null) {
+          binaryRelationHelper =
+            new BinaryRelationHelper<dsHiveServerTableAdapters.ClientGroup_ResourceTableAdapter,
+              dsHiveServer.ClientGroup_ResourceRow>(new ClientGroup_ResourceAdapterWrapper());
+        }
+
+        binaryRelationHelper.Session = Session as Session;
+
+        return binaryRelationHelper;
+      }
+    }
 
     private IResourceAdapter resourceAdapter = null;
@@ -122,54 +183,23 @@
         /*Parent - Permission Owner*/
         clientGroup.Id = row.ResourceId;
-        ResAdapter.GetById(clientGroup);
-
-        //first check for created references
-        dsHiveServer.ClientGroup_ResourceDataTable clientGroupRows =
-            resourceClientGroupAdapter.GetDataByClientGroupId(clientGroup.Id);
-
-        foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in
-          clientGroupRows) {
-          Resource resource = null;
-
-          IEnumerable<Resource> resources =
-            from p in
-              clientGroup.Resources
-            where p.Id == resourceClientGroupRow.ResourceId
-            select p;
-          if (resources.Count<Resource>() == 1)
-            resource = resources.First<Resource>();
-
-          if (resource == null) {
-            Resource res =
-              ClientAdapter.GetById(resourceClientGroupRow.ResourceId);
-
-            if (res == null) {
-              //is a client group
-              res =
-                GetById(resourceClientGroupRow.ResourceId);
-            }
-
-            if (res != null)
-              clientGroup.Resources.Add(res);
-          }
-        }
-
-        //secondly check for deleted references
-        ICollection<Resource> deleted =
-          new List<Resource>();
-
-        foreach (Resource resource in clientGroup.Resources) {
-          dsHiveServer.ClientGroup_ResourceDataTable found =
-            resourceClientGroupAdapter.GetDataByClientGroupResourceId(
-            clientGroup.Id,
-            resource.Id);
-
-          if (found.Count != 1) {
-            deleted.Add(resource);
-          }
-        }
-
-        foreach (Resource resource in deleted) {
-          clientGroup.Resources.Remove(resource);
+        ResAdapter.GetById(clientGroup.Id);
+
+        ICollection<Guid> resources =
+          BinaryRelationHelper.GetRelationships(clientGroup.Id);
+
+       clientGroup.Resources.Clear();
+        foreach(Guid resource in resources) {
+          ClientInfo client = 
+            ClientAdapter.GetById(resource);
+
+          if (client == null) {
+            //client group
+            ClientGroup group =
+              GetById(resource);
+
+            clientGroup.Resources.Add(group);
+          } else {
+            clientGroup.Resources.Add(client);
+          }          
         }
 
@@ -183,69 +213,4 @@
       if (clientGroup != null && row != null) {
         row.ResourceId = clientGroup.Id;
-
-        //update references
-        foreach (Resource resource in clientGroup.Resources) {
-          //first update the member to make sure it exists in the DB
-          if (resource is ClientInfo) {
-            ClientAdapter.Update(resource as ClientInfo);
-          } else if (resource is ClientGroup) {
-            Update(resource as ClientGroup);
-          }
-
-          //secondly check for created references
-          dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow =
-            null;
-          dsHiveServer.ClientGroup_ResourceDataTable found =
-            resourceClientGroupAdapter.GetDataByClientGroupResourceId(
-              clientGroup.Id,
-              resource.Id);
-          if (found.Count == 1)
-            resourceClientGroupRow = found[0];
-
-          if (resourceClientGroupRow == null) {
-            resourceClientGroupRow =
-              found.NewClientGroup_ResourceRow();
-
-            resourceClientGroupRow.ResourceId =
-              resource.Id;
-            resourceClientGroupRow.ClientGroupId =
-              clientGroup.Id;
-
-            found.AddClientGroup_ResourceRow(resourceClientGroupRow);
-
-            resourceClientGroupAdapter.Update(
-              resourceClientGroupRow);
-          }
-        }
-
-        //thirdly check for deleted references
-        dsHiveServer.ClientGroup_ResourceDataTable clientGroupRows =
-          resourceClientGroupAdapter.GetDataByClientGroupId(clientGroup.Id);
-
-        ICollection<dsHiveServer.ClientGroup_ResourceRow> deleted =
-          new List<dsHiveServer.ClientGroup_ResourceRow>();
-
-        foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in
-          clientGroupRows) {
-          Resource resource = null;
-
-          IEnumerable<Resource> resources =
-            from r in
-              clientGroup.Resources
-            where r.Id == resourceClientGroupRow.ResourceId
-            select r;
-
-          if (resources.Count<Resource>() == 1)
-            resource = resources.First<Resource>();
-
-          if (resource == null) {
-            deleted.Add(resourceClientGroupRow);
-          }
-        }
-
-        foreach (dsHiveServer.ClientGroup_ResourceRow resourceClientGroupRow in deleted) {
-          resourceClientGroupRow.Delete();
-          resourceClientGroupAdapter.Update(resourceClientGroupRow);
-        }
       }
 
@@ -260,4 +225,21 @@
 
         base.doUpdate(group);
+
+        List<Guid> relationships = 
+          new List<Guid>();
+        foreach(Resource res in group.Resources) {
+          if (res is ClientInfo) {
+            ClientAdapter.Update(res as ClientInfo);
+          } else if (res is ClientGroup) {
+            Update(res as ClientGroup);
+          } else {
+            ResAdapter.Update(res);
+          }
+
+          relationships.Add(res.Id);
+        }
+
+        BinaryRelationHelper.UpdateRelationships(group.Id,
+          relationships);
       }
     }
@@ -276,24 +258,13 @@
 
     public ICollection<ClientGroup> MemberOf(Resource resource) {
-      ICollection<ClientGroup> clientGroups =
-        new List<ClientGroup>();
-
-      if (resource != null) {
-        IEnumerable<dsHiveServer.ClientGroup_ResourceRow> clientGroupRows =
-         resourceClientGroupAdapter.GetDataByResourceId(resource.Id);
-
-        foreach (dsHiveServer.ClientGroup_ResourceRow clientGroupRow in
-          clientGroupRows) {
-          ClientGroup clientGroup =
-            GetById(clientGroupRow.ClientGroupId);
-          clientGroups.Add(clientGroup);
-        }
-      }
-
-      return clientGroups;
+      throw new NotImplementedException();
     }
 
     protected override bool doDelete(ClientGroup group) {
       if (group != null) {
+        //delete all relationships
+        BinaryRelationHelper.UpdateRelationships(group.Id,
+          new List<Guid>());
+
         return base.doDelete(group) && 
           ResAdapter.Delete(group);
Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ResourceAdapter.cs	(revision 1515)
@@ -139,18 +139,9 @@
 
     public Resource GetByName(string name) {
-      dsHiveServer.ResourceRow row =
-        base.FindSingleRow(
+      return
+        base.FindSingle (
           delegate() {
             return Adapter.GetDataByName(name);
           });
-
-      if (row != null) {
-        Resource res = new Resource();
-        res = Convert(row, res);
-
-        return res;
-      } else {
-        return null;
-      }
     }
 
Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs	(revision 1515)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3082
+//     Runtime Version:2.0.50727.3053
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
@@ -46,13 +46,13 @@
         private global::System.Data.DataRelation relationClientGroup_is_a_Resource;
         
+        private global::System.Data.DataRelation relationR_21;
+        
+        private global::System.Data.DataRelation relationR_14;
+        
+        private global::System.Data.DataRelation relationR_51;
+        
+        private global::System.Data.DataRelation relationR_54;
+        
         private global::System.Data.DataRelation relationR_52;
-        
-        private global::System.Data.DataRelation relationR_21;
-        
-        private global::System.Data.DataRelation relationR_14;
-        
-        private global::System.Data.DataRelation relationR_51;
-        
-        private global::System.Data.DataRelation relationR_54;
         
         private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
@@ -359,9 +359,9 @@
             this.relationClient_is_a_Resource = this.Relations["Client_is_a_Resource"];
             this.relationClientGroup_is_a_Resource = this.Relations["ClientGroup_is_a_Resource"];
-            this.relationR_52 = this.Relations["R_52"];
             this.relationR_21 = this.Relations["R_21"];
             this.relationR_14 = this.Relations["R_14"];
             this.relationR_51 = this.Relations["R_51"];
             this.relationR_54 = this.Relations["R_54"];
+            this.relationR_52 = this.Relations["R_52"];
         }
         
@@ -397,8 +397,4 @@
                         this.tableClientGroup.ResourceIdColumn}, false);
             this.Relations.Add(this.relationClientGroup_is_a_Resource);
-            this.relationR_52 = new global::System.Data.DataRelation("R_52", new global::System.Data.DataColumn[] {
-                        this.tableClientGroup.ResourceIdColumn}, new global::System.Data.DataColumn[] {
-                        this.tableClientGroup_Resource.ClientGroupIdColumn}, false);
-            this.Relations.Add(this.relationR_52);
             this.relationR_21 = new global::System.Data.DataRelation("R_21", new global::System.Data.DataColumn[] {
                         this.tableClient.ResourceIdColumn}, new global::System.Data.DataColumn[] {
@@ -417,4 +413,8 @@
                         this.tableRequiredPlugins.PluginIdColumn}, false);
             this.Relations.Add(this.relationR_54);
+            this.relationR_52 = new global::System.Data.DataRelation("R_52", new global::System.Data.DataColumn[] {
+                        this.tableResource.ResourceIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tableClientGroup_Resource.ClientGroupIdColumn}, false);
+            this.Relations.Add(this.relationR_52);
         }
         
@@ -1437,11 +1437,11 @@
             
             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-            public ClientGroup_ResourceRow AddClientGroup_ResourceRow(ClientGroupRow parentClientGroupRowByR_52, System.Guid ResourceId) {
+            public ClientGroup_ResourceRow AddClientGroup_ResourceRow(ResourceRow parentResourceRowByR_52, System.Guid ResourceId) {
                 ClientGroup_ResourceRow rowClientGroup_ResourceRow = ((ClientGroup_ResourceRow)(this.NewRow()));
                 object[] columnValuesArray = new object[] {
                         null,
                         ResourceId};
-                if ((parentClientGroupRowByR_52 != null)) {
-                    columnValuesArray[0] = parentClientGroupRowByR_52[0];
+                if ((parentResourceRowByR_52 != null)) {
+                    columnValuesArray[0] = parentResourceRowByR_52[0];
                 }
                 rowClientGroup_ResourceRow.ItemArray = columnValuesArray;
@@ -3125,4 +3125,14 @@
                 }
             }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public ClientGroup_ResourceRow[] GetClientGroup_ResourceRows() {
+                if ((this.Table.ChildRelations["R_52"] == null)) {
+                    return new ClientGroup_ResourceRow[0];
+                }
+                else {
+                    return ((ClientGroup_ResourceRow[])(base.GetChildRows(this.Table.ChildRelations["R_52"])));
+                }
+            }
         }
         
@@ -3160,14 +3170,4 @@
                 }
             }
-            
-            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-            public ClientGroup_ResourceRow[] GetClientGroup_ResourceRows() {
-                if ((this.Table.ChildRelations["R_52"] == null)) {
-                    return new ClientGroup_ResourceRow[0];
-                }
-                else {
-                    return ((ClientGroup_ResourceRow[])(base.GetChildRows(this.Table.ChildRelations["R_52"])));
-                }
-            }
         }
         
@@ -3207,7 +3207,7 @@
             
             [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-            public ClientGroupRow ClientGroupRow {
-                get {
-                    return ((ClientGroupRow)(this.GetParentRow(this.Table.ParentRelations["R_52"])));
+            public ResourceRow ResourceRow {
+                get {
+                    return ((ResourceRow)(this.GetParentRow(this.Table.ParentRelations["R_52"])));
                 }
                 set {
@@ -8307,10 +8307,10 @@
                 }
             }
-            if ((this._clientGroupTableAdapter != null)) {
-                global::System.Data.DataRow[] updatedRows = dataSet.ClientGroup.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+            if ((this._requiredPluginsTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.RequiredPlugins.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
                 updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
                 if (((updatedRows != null) 
                             && (0 < updatedRows.Length))) {
-                    result = (result + this._clientGroupTableAdapter.Update(updatedRows));
+                    result = (result + this._requiredPluginsTableAdapter.Update(updatedRows));
                     allChangedRows.AddRange(updatedRows);
                 }
@@ -8325,10 +8325,10 @@
                 }
             }
-            if ((this._requiredPluginsTableAdapter != null)) {
-                global::System.Data.DataRow[] updatedRows = dataSet.RequiredPlugins.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+            if ((this._clientGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.ClientGroup.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
                 updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
                 if (((updatedRows != null) 
                             && (0 < updatedRows.Length))) {
-                    result = (result + this._requiredPluginsTableAdapter.Update(updatedRows));
+                    result = (result + this._clientGroupTableAdapter.Update(updatedRows));
                     allChangedRows.AddRange(updatedRows);
                 }
@@ -8384,9 +8384,9 @@
                 }
             }
-            if ((this._clientGroupTableAdapter != null)) {
-                global::System.Data.DataRow[] addedRows = dataSet.ClientGroup.Select(null, null, global::System.Data.DataViewRowState.Added);
+            if ((this._requiredPluginsTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.RequiredPlugins.Select(null, null, global::System.Data.DataViewRowState.Added);
                 if (((addedRows != null) 
                             && (0 < addedRows.Length))) {
-                    result = (result + this._clientGroupTableAdapter.Update(addedRows));
+                    result = (result + this._requiredPluginsTableAdapter.Update(addedRows));
                     allAddedRows.AddRange(addedRows);
                 }
@@ -8400,9 +8400,9 @@
                 }
             }
-            if ((this._requiredPluginsTableAdapter != null)) {
-                global::System.Data.DataRow[] addedRows = dataSet.RequiredPlugins.Select(null, null, global::System.Data.DataViewRowState.Added);
+            if ((this._clientGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.ClientGroup.Select(null, null, global::System.Data.DataViewRowState.Added);
                 if (((addedRows != null) 
                             && (0 < addedRows.Length))) {
-                    result = (result + this._requiredPluginsTableAdapter.Update(addedRows));
+                    result = (result + this._clientGroupTableAdapter.Update(addedRows));
                     allAddedRows.AddRange(addedRows);
                 }
@@ -8433,9 +8433,9 @@
                 }
             }
-            if ((this._requiredPluginsTableAdapter != null)) {
-                global::System.Data.DataRow[] deletedRows = dataSet.RequiredPlugins.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+            if ((this._clientGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.ClientGroup.Select(null, null, global::System.Data.DataViewRowState.Deleted);
                 if (((deletedRows != null) 
                             && (0 < deletedRows.Length))) {
-                    result = (result + this._requiredPluginsTableAdapter.Update(deletedRows));
+                    result = (result + this._clientGroupTableAdapter.Update(deletedRows));
                     allChangedRows.AddRange(deletedRows);
                 }
@@ -8449,9 +8449,9 @@
                 }
             }
-            if ((this._clientGroupTableAdapter != null)) {
-                global::System.Data.DataRow[] deletedRows = dataSet.ClientGroup.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+            if ((this._requiredPluginsTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.RequiredPlugins.Select(null, null, global::System.Data.DataViewRowState.Deleted);
                 if (((deletedRows != null) 
                             && (0 < deletedRows.Length))) {
-                    result = (result + this._clientGroupTableAdapter.Update(deletedRows));
+                    result = (result + this._requiredPluginsTableAdapter.Update(deletedRows));
                     allChangedRows.AddRange(deletedRows);
                 }
Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd	(revision 1515)
@@ -758,9 +758,9 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
-              <xs:element name="CPUSpeed" msprop:Generator_UserColumnName="CPUSpeed" msprop:Generator_ColumnPropNameInRow="CPUSpeed" msprop:Generator_ColumnVarNameInTable="columnCPUSpeed" msprop:Generator_ColumnPropNameInTable="CPUSpeedColumn" type="xs:int" minOccurs="0" />
-              <xs:element name="Memory" msprop:Generator_UserColumnName="Memory" msprop:Generator_ColumnPropNameInRow="Memory" msprop:Generator_ColumnVarNameInTable="columnMemory" msprop:Generator_ColumnPropNameInTable="MemoryColumn" type="xs:int" minOccurs="0" />
-              <xs:element name="Login" msprop:Generator_UserColumnName="Login" msprop:Generator_ColumnPropNameInRow="Login" msprop:Generator_ColumnVarNameInTable="columnLogin" msprop:Generator_ColumnPropNameInTable="LoginColumn" type="xs:dateTime" minOccurs="0" />
-              <xs:element name="Status" msprop:Generator_UserColumnName="Status" msprop:Generator_ColumnPropNameInRow="Status" msprop:Generator_ColumnVarNameInTable="columnStatus" msprop:Generator_ColumnPropNameInTable="StatusColumn" minOccurs="0">
+              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
+              <xs:element name="CPUSpeed" msprop:Generator_UserColumnName="CPUSpeed" msprop:Generator_ColumnVarNameInTable="columnCPUSpeed" msprop:Generator_ColumnPropNameInRow="CPUSpeed" msprop:Generator_ColumnPropNameInTable="CPUSpeedColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="Memory" msprop:Generator_UserColumnName="Memory" msprop:Generator_ColumnVarNameInTable="columnMemory" msprop:Generator_ColumnPropNameInRow="Memory" msprop:Generator_ColumnPropNameInTable="MemoryColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="Login" msprop:Generator_UserColumnName="Login" msprop:Generator_ColumnVarNameInTable="columnLogin" msprop:Generator_ColumnPropNameInRow="Login" msprop:Generator_ColumnPropNameInTable="LoginColumn" type="xs:dateTime" minOccurs="0" />
+              <xs:element name="Status" msprop:Generator_UserColumnName="Status" msprop:Generator_ColumnVarNameInTable="columnStatus" msprop:Generator_ColumnPropNameInRow="Status" msprop:Generator_ColumnPropNameInTable="StatusColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -769,8 +769,8 @@
                 </xs:simpleType>
               </xs:element>
-              <xs:element name="ClientConfigId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ClientConfigId" msprop:Generator_ColumnPropNameInRow="ClientConfigId" msprop:Generator_ColumnVarNameInTable="columnClientConfigId" msprop:Generator_ColumnPropNameInTable="ClientConfigIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="NumberOfCores" msprop:Generator_UserColumnName="NumberOfCores" msprop:Generator_ColumnPropNameInRow="NumberOfCores" msprop:Generator_ColumnVarNameInTable="columnNumberOfCores" msprop:Generator_ColumnPropNameInTable="NumberOfCoresColumn" type="xs:int" minOccurs="0" />
-              <xs:element name="NumberOfFreeCores" msprop:Generator_UserColumnName="NumberOfFreeCores" msprop:Generator_ColumnVarNameInTable="columnNumberOfFreeCores" msprop:Generator_ColumnPropNameInRow="NumberOfFreeCores" msprop:Generator_ColumnPropNameInTable="NumberOfFreeCoresColumn" type="xs:int" minOccurs="0" />
-              <xs:element name="FreeMemory" msprop:Generator_UserColumnName="FreeMemory" msprop:Generator_ColumnVarNameInTable="columnFreeMemory" msprop:Generator_ColumnPropNameInRow="FreeMemory" msprop:Generator_ColumnPropNameInTable="FreeMemoryColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="ClientConfigId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ClientConfigId" msprop:Generator_ColumnVarNameInTable="columnClientConfigId" msprop:Generator_ColumnPropNameInRow="ClientConfigId" msprop:Generator_ColumnPropNameInTable="ClientConfigIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="NumberOfCores" msprop:Generator_UserColumnName="NumberOfCores" msprop:Generator_ColumnVarNameInTable="columnNumberOfCores" msprop:Generator_ColumnPropNameInRow="NumberOfCores" msprop:Generator_ColumnPropNameInTable="NumberOfCoresColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="NumberOfFreeCores" msprop:Generator_UserColumnName="NumberOfFreeCores" msprop:Generator_ColumnPropNameInRow="NumberOfFreeCores" msprop:Generator_ColumnVarNameInTable="columnNumberOfFreeCores" msprop:Generator_ColumnPropNameInTable="NumberOfFreeCoresColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="FreeMemory" msprop:Generator_UserColumnName="FreeMemory" msprop:Generator_ColumnPropNameInRow="FreeMemory" msprop:Generator_ColumnVarNameInTable="columnFreeMemory" msprop:Generator_ColumnPropNameInTable="FreeMemoryColumn" type="xs:int" minOccurs="0" />
             </xs:sequence>
           </xs:complexType>
@@ -779,6 +779,6 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
-              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
+              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
+              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -793,5 +793,5 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
+              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
@@ -800,6 +800,6 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="ClientGroupId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ClientGroupId" msprop:Generator_ColumnVarNameInTable="columnClientGroupId" msprop:Generator_ColumnPropNameInRow="ClientGroupId" msprop:Generator_ColumnPropNameInTable="ClientGroupIdColumn" type="xs:string" />
-              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
+              <xs:element name="ClientGroupId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ClientGroupId" msprop:Generator_ColumnPropNameInRow="ClientGroupId" msprop:Generator_ColumnVarNameInTable="columnClientGroupId" msprop:Generator_ColumnPropNameInTable="ClientGroupIdColumn" type="xs:string" />
+              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
@@ -808,7 +808,7 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="JobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobId" msprop:Generator_ColumnVarNameInTable="columnJobId" msprop:Generator_ColumnPropNameInRow="JobId" msprop:Generator_ColumnPropNameInTable="JobIdColumn" type="xs:string" />
-              <xs:element name="ParentJobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ParentJobId" msprop:Generator_ColumnVarNameInTable="columnParentJobId" msprop:Generator_ColumnPropNameInRow="ParentJobId" msprop:Generator_ColumnPropNameInTable="ParentJobIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="JobState" msprop:Generator_UserColumnName="JobState" msprop:Generator_ColumnVarNameInTable="columnJobState" msprop:Generator_ColumnPropNameInRow="JobState" msprop:Generator_ColumnPropNameInTable="JobStateColumn" minOccurs="0">
+              <xs:element name="JobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobId" msprop:Generator_ColumnPropNameInRow="JobId" msprop:Generator_ColumnVarNameInTable="columnJobId" msprop:Generator_ColumnPropNameInTable="JobIdColumn" type="xs:string" />
+              <xs:element name="ParentJobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ParentJobId" msprop:Generator_ColumnPropNameInRow="ParentJobId" msprop:Generator_ColumnVarNameInTable="columnParentJobId" msprop:Generator_ColumnPropNameInTable="ParentJobIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="JobState" msprop:Generator_UserColumnName="JobState" msprop:Generator_ColumnPropNameInRow="JobState" msprop:Generator_ColumnVarNameInTable="columnJobState" msprop:Generator_ColumnPropNameInTable="JobStateColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -817,14 +817,14 @@
                 </xs:simpleType>
               </xs:element>
-              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="Percentage" msprop:Generator_UserColumnName="Percentage" msprop:Generator_ColumnVarNameInTable="columnPercentage" msprop:Generator_ColumnPropNameInRow="Percentage" msprop:Generator_ColumnPropNameInTable="PercentageColumn" type="xs:double" minOccurs="0" />
-              <xs:element name="SerializedJob" msprop:Generator_UserColumnName="SerializedJob" msprop:Generator_ColumnVarNameInTable="columnSerializedJob" msprop:Generator_ColumnPropNameInRow="SerializedJob" msprop:Generator_ColumnPropNameInTable="SerializedJobColumn" type="xs:base64Binary" minOccurs="0" />
-              <xs:element name="DateCreated" msprop:Generator_UserColumnName="DateCreated" msprop:Generator_ColumnVarNameInTable="columnDateCreated" msprop:Generator_ColumnPropNameInRow="DateCreated" msprop:Generator_ColumnPropNameInTable="DateCreatedColumn" type="xs:dateTime" minOccurs="0" />
-              <xs:element name="DateCalculated" msprop:Generator_UserColumnName="DateCalculated" msprop:Generator_ColumnVarNameInTable="columnDateCalculated" msprop:Generator_ColumnPropNameInRow="DateCalculated" msprop:Generator_ColumnPropNameInTable="DateCalculatedColumn" type="xs:dateTime" minOccurs="0" />
-              <xs:element name="Priority" msprop:Generator_UserColumnName="Priority" msprop:Generator_ColumnVarNameInTable="columnPriority" msprop:Generator_ColumnPropNameInRow="Priority" msprop:Generator_ColumnPropNameInTable="PriorityColumn" type="xs:int" minOccurs="0" />
-              <xs:element name="ProjectId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ProjectId" msprop:Generator_ColumnVarNameInTable="columnProjectId" msprop:Generator_ColumnPropNameInRow="ProjectId" msprop:Generator_ColumnPropNameInTable="ProjectIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="UserId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="UserId" msprop:Generator_ColumnVarNameInTable="columnUserId" msprop:Generator_ColumnPropNameInRow="UserId" msprop:Generator_ColumnPropNameInTable="UserIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="CoresNeeded" msprop:Generator_UserColumnName="CoresNeeded" msprop:Generator_ColumnVarNameInTable="columnCoresNeeded" msprop:Generator_ColumnPropNameInRow="CoresNeeded" msprop:Generator_ColumnPropNameInTable="CoresNeededColumn" type="xs:int" minOccurs="0" />
-              <xs:element name="MemoryNeeded" msprop:Generator_UserColumnName="MemoryNeeded" msprop:Generator_ColumnVarNameInTable="columnMemoryNeeded" msprop:Generator_ColumnPropNameInRow="MemoryNeeded" msprop:Generator_ColumnPropNameInTable="MemoryNeededColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="Percentage" msprop:Generator_UserColumnName="Percentage" msprop:Generator_ColumnPropNameInRow="Percentage" msprop:Generator_ColumnVarNameInTable="columnPercentage" msprop:Generator_ColumnPropNameInTable="PercentageColumn" type="xs:double" minOccurs="0" />
+              <xs:element name="SerializedJob" msprop:Generator_UserColumnName="SerializedJob" msprop:Generator_ColumnPropNameInRow="SerializedJob" msprop:Generator_ColumnVarNameInTable="columnSerializedJob" msprop:Generator_ColumnPropNameInTable="SerializedJobColumn" type="xs:base64Binary" minOccurs="0" />
+              <xs:element name="DateCreated" msprop:Generator_UserColumnName="DateCreated" msprop:Generator_ColumnPropNameInRow="DateCreated" msprop:Generator_ColumnVarNameInTable="columnDateCreated" msprop:Generator_ColumnPropNameInTable="DateCreatedColumn" type="xs:dateTime" minOccurs="0" />
+              <xs:element name="DateCalculated" msprop:Generator_UserColumnName="DateCalculated" msprop:Generator_ColumnPropNameInRow="DateCalculated" msprop:Generator_ColumnVarNameInTable="columnDateCalculated" msprop:Generator_ColumnPropNameInTable="DateCalculatedColumn" type="xs:dateTime" minOccurs="0" />
+              <xs:element name="Priority" msprop:Generator_UserColumnName="Priority" msprop:Generator_ColumnPropNameInRow="Priority" msprop:Generator_ColumnVarNameInTable="columnPriority" msprop:Generator_ColumnPropNameInTable="PriorityColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="ProjectId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ProjectId" msprop:Generator_ColumnPropNameInRow="ProjectId" msprop:Generator_ColumnVarNameInTable="columnProjectId" msprop:Generator_ColumnPropNameInTable="ProjectIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="UserId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="UserId" msprop:Generator_ColumnPropNameInRow="UserId" msprop:Generator_ColumnVarNameInTable="columnUserId" msprop:Generator_ColumnPropNameInTable="UserIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="CoresNeeded" msprop:Generator_UserColumnName="CoresNeeded" msprop:Generator_ColumnPropNameInRow="CoresNeeded" msprop:Generator_ColumnVarNameInTable="columnCoresNeeded" msprop:Generator_ColumnPropNameInTable="CoresNeededColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="MemoryNeeded" msprop:Generator_UserColumnName="MemoryNeeded" msprop:Generator_ColumnPropNameInRow="MemoryNeeded" msprop:Generator_ColumnVarNameInTable="columnMemoryNeeded" msprop:Generator_ColumnPropNameInTable="MemoryNeededColumn" type="xs:int" minOccurs="0" />
             </xs:sequence>
           </xs:complexType>
@@ -833,8 +833,8 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="JobResultId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobResultId" msprop:Generator_ColumnVarNameInTable="columnJobResultId" msprop:Generator_ColumnPropNameInRow="JobResultId" msprop:Generator_ColumnPropNameInTable="JobResultIdColumn" type="xs:string" />
-              <xs:element name="JobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobId" msprop:Generator_ColumnVarNameInTable="columnJobId" msprop:Generator_ColumnPropNameInRow="JobId" msprop:Generator_ColumnPropNameInTable="JobIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="JobResult" msprop:Generator_UserColumnName="JobResult" msprop:Generator_ColumnVarNameInTable="columnJobResult" msprop:Generator_ColumnPropNameInRow="JobResult" msprop:Generator_ColumnPropNameInTable="JobResultColumn" type="xs:base64Binary" minOccurs="0" />
-              <xs:element name="Message" msprop:Generator_UserColumnName="Message" msprop:Generator_ColumnVarNameInTable="columnMessage" msprop:Generator_ColumnPropNameInRow="Message" msprop:Generator_ColumnPropNameInTable="MessageColumn" minOccurs="0">
+              <xs:element name="JobResultId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobResultId" msprop:Generator_ColumnPropNameInRow="JobResultId" msprop:Generator_ColumnVarNameInTable="columnJobResultId" msprop:Generator_ColumnPropNameInTable="JobResultIdColumn" type="xs:string" />
+              <xs:element name="JobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobId" msprop:Generator_ColumnPropNameInRow="JobId" msprop:Generator_ColumnVarNameInTable="columnJobId" msprop:Generator_ColumnPropNameInTable="JobIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="JobResult" msprop:Generator_UserColumnName="JobResult" msprop:Generator_ColumnPropNameInRow="JobResult" msprop:Generator_ColumnVarNameInTable="columnJobResult" msprop:Generator_ColumnPropNameInTable="JobResultColumn" type="xs:base64Binary" minOccurs="0" />
+              <xs:element name="Message" msprop:Generator_UserColumnName="Message" msprop:Generator_ColumnPropNameInRow="Message" msprop:Generator_ColumnVarNameInTable="columnMessage" msprop:Generator_ColumnPropNameInTable="MessageColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -843,7 +843,7 @@
                 </xs:simpleType>
               </xs:element>
-              <xs:element name="Percentage" msprop:Generator_UserColumnName="Percentage" msprop:Generator_ColumnVarNameInTable="columnPercentage" msprop:Generator_ColumnPropNameInRow="Percentage" msprop:Generator_ColumnPropNameInTable="PercentageColumn" type="xs:double" minOccurs="0" />
-              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" minOccurs="0" />
-              <xs:element name="DateFinished" msprop:Generator_UserColumnName="DateFinished" msprop:Generator_ColumnVarNameInTable="columnDateFinished" msprop:Generator_ColumnPropNameInRow="DateFinished" msprop:Generator_ColumnPropNameInTable="DateFinishedColumn" type="xs:dateTime" minOccurs="0" />
+              <xs:element name="Percentage" msprop:Generator_UserColumnName="Percentage" msprop:Generator_ColumnPropNameInRow="Percentage" msprop:Generator_ColumnVarNameInTable="columnPercentage" msprop:Generator_ColumnPropNameInTable="PercentageColumn" type="xs:double" minOccurs="0" />
+              <xs:element name="ResourceId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="DateFinished" msprop:Generator_UserColumnName="DateFinished" msprop:Generator_ColumnPropNameInRow="DateFinished" msprop:Generator_ColumnVarNameInTable="columnDateFinished" msprop:Generator_ColumnPropNameInTable="DateFinishedColumn" type="xs:dateTime" minOccurs="0" />
             </xs:sequence>
           </xs:complexType>
@@ -852,6 +852,6 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="JobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobId" msprop:Generator_ColumnVarNameInTable="columnJobId" msprop:Generator_ColumnPropNameInRow="JobId" msprop:Generator_ColumnPropNameInTable="JobIdColumn" type="xs:string" />
-              <xs:element name="PluginId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PluginId" msprop:Generator_ColumnVarNameInTable="columnPluginId" msprop:Generator_ColumnPropNameInRow="PluginId" msprop:Generator_ColumnPropNameInTable="PluginIdColumn" type="xs:string" />
+              <xs:element name="JobId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="JobId" msprop:Generator_ColumnPropNameInRow="JobId" msprop:Generator_ColumnVarNameInTable="columnJobId" msprop:Generator_ColumnPropNameInTable="JobIdColumn" type="xs:string" />
+              <xs:element name="PluginId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PluginId" msprop:Generator_ColumnPropNameInRow="PluginId" msprop:Generator_ColumnVarNameInTable="columnPluginId" msprop:Generator_ColumnPropNameInTable="PluginIdColumn" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
@@ -860,6 +860,6 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PluginId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PluginId" msprop:Generator_ColumnPropNameInRow="PluginId" msprop:Generator_ColumnVarNameInTable="columnPluginId" msprop:Generator_ColumnPropNameInTable="PluginIdColumn" type="xs:string" />
-              <xs:element name="SerializedInfo" msprop:Generator_UserColumnName="SerializedInfo" msprop:Generator_ColumnPropNameInRow="SerializedInfo" msprop:Generator_ColumnVarNameInTable="columnSerializedInfo" msprop:Generator_ColumnPropNameInTable="SerializedInfoColumn" minOccurs="0">
+              <xs:element name="PluginId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PluginId" msprop:Generator_ColumnVarNameInTable="columnPluginId" msprop:Generator_ColumnPropNameInRow="PluginId" msprop:Generator_ColumnPropNameInTable="PluginIdColumn" type="xs:string" />
+              <xs:element name="SerializedInfo" msprop:Generator_UserColumnName="SerializedInfo" msprop:Generator_ColumnVarNameInTable="columnSerializedInfo" msprop:Generator_ColumnPropNameInRow="SerializedInfo" msprop:Generator_ColumnPropNameInTable="SerializedInfoColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -912,9 +912,9 @@
       <msdata:Relationship name="Client_is_a_Resource" msdata:parent="Resource" msdata:child="Client" msdata:parentkey="ResourceId" msdata:childkey="ResourceId" msprop:Generator_UserRelationName="Client_is_a_Resource" msprop:Generator_RelationVarName="relationClient_is_a_Resource" msprop:Generator_UserChildTable="Client" msprop:Generator_UserParentTable="Resource" msprop:Generator_ParentPropName="ResourceRow" msprop:Generator_ChildPropName="GetClientRows" />
       <msdata:Relationship name="ClientGroup_is_a_Resource" msdata:parent="Resource" msdata:child="ClientGroup" msdata:parentkey="ResourceId" msdata:childkey="ResourceId" msprop:Generator_UserRelationName="ClientGroup_is_a_Resource" msprop:Generator_RelationVarName="relationClientGroup_is_a_Resource" msprop:Generator_UserChildTable="ClientGroup" msprop:Generator_UserParentTable="Resource" msprop:Generator_ParentPropName="ResourceRow" msprop:Generator_ChildPropName="GetClientGroupRows" />
-      <msdata:Relationship name="R_52" msdata:parent="ClientGroup" msdata:child="ClientGroup_Resource" msdata:parentkey="ResourceId" msdata:childkey="ClientGroupId" msprop:Generator_UserRelationName="R_52" msprop:Generator_RelationVarName="relationR_52" msprop:Generator_UserChildTable="ClientGroup_Resource" msprop:Generator_UserParentTable="ClientGroup" msprop:Generator_ParentPropName="ClientGroupRow" msprop:Generator_ChildPropName="GetClientGroup_ResourceRows" />
       <msdata:Relationship name="R_21" msdata:parent="Client" msdata:child="Job" msdata:parentkey="ResourceId" msdata:childkey="ResourceId" msprop:Generator_UserRelationName="R_21" msprop:Generator_RelationVarName="relationR_21" msprop:Generator_UserChildTable="Job" msprop:Generator_UserParentTable="Client" msprop:Generator_ParentPropName="ClientRow" msprop:Generator_ChildPropName="GetJobRows" />
       <msdata:Relationship name="R_14" msdata:parent="Job" msdata:child="JobResult" msdata:parentkey="JobId" msdata:childkey="JobId" msprop:Generator_UserRelationName="R_14" msprop:Generator_RelationVarName="relationR_14" msprop:Generator_UserChildTable="JobResult" msprop:Generator_UserParentTable="Job" msprop:Generator_ParentPropName="JobRow" msprop:Generator_ChildPropName="GetJobResultRows" />
       <msdata:Relationship name="R_51" msdata:parent="Job" msdata:child="RequiredPlugins" msdata:parentkey="JobId" msdata:childkey="JobId" msprop:Generator_UserRelationName="R_51" msprop:Generator_RelationVarName="relationR_51" msprop:Generator_UserChildTable="RequiredPlugins" msprop:Generator_UserParentTable="Job" msprop:Generator_ParentPropName="JobRow" msprop:Generator_ChildPropName="GetRequiredPluginsRows" />
       <msdata:Relationship name="R_54" msdata:parent="PluginInfo" msdata:child="RequiredPlugins" msdata:parentkey="PluginId" msdata:childkey="PluginId" msprop:Generator_UserRelationName="R_54" msprop:Generator_RelationVarName="relationR_54" msprop:Generator_UserChildTable="RequiredPlugins" msprop:Generator_UserParentTable="PluginInfo" msprop:Generator_ParentPropName="PluginInfoRow" msprop:Generator_ChildPropName="GetRequiredPluginsRows" />
+      <msdata:Relationship name="R_52" msdata:parent="Resource" msdata:child="ClientGroup_Resource" msdata:parentkey="ResourceId" msdata:childkey="ClientGroupId" msprop:Generator_UserRelationName="R_52" msprop:Generator_RelationVarName="relationR_52" msprop:Generator_UserChildTable="ClientGroup_Resource" msprop:Generator_UserParentTable="Resource" msprop:Generator_ParentPropName="ResourceRow" msprop:Generator_ChildPropName="GetClientGroup_ResourceRows" />
     </xs:appinfo>
   </xs:annotation>
Index: /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss	(revision 1515)
@@ -5,14 +5,14 @@
      the code is regenerated.
 </autogenerated>-->
-<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-457" ViewPortY="171" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
+<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-148" ViewPortY="479" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
   <Shapes>
-    <Shape ID="DesignTable:Client" ZOrder="12" X="-37" Y="593" Height="258" Width="179" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="177" />
-    <Shape ID="DesignTable:Resource" ZOrder="2" X="215" Y="348" Height="156" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="22" SplitterPosition="58" />
-    <Shape ID="DesignTable:ClientGroup" ZOrder="14" X="251" Y="607" Height="106" Width="209" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
-    <Shape ID="DesignTable:ClientGroup_Resource" ZOrder="11" X="215" Y="765" Height="90" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="0" />
-    <Shape ID="DesignTable:Job" ZOrder="1" X="-374" Y="215" Height="343" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="22" OldDataTableHeight="0" SplitterPosition="228" />
-    <Shape ID="DesignTable:JobResult" ZOrder="10" X="146" Y="172" Height="90" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="0" />
-    <Shape ID="DesignTable:RequiredPlugins" ZOrder="6" X="-498" Y="629" Height="105" Width="235" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
-    <Shape ID="DesignTable:PluginInfo" ZOrder="4" X="-454" Y="759" Height="105" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="22" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:Client" ZOrder="13" X="-37" Y="593" Height="258" Width="179" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="177" />
+    <Shape ID="DesignTable:Resource" ZOrder="4" X="215" Y="348" Height="156" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="22" SplitterPosition="58" />
+    <Shape ID="DesignTable:ClientGroup" ZOrder="2" X="346" Y="589" Height="106" Width="209" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
+    <Shape ID="DesignTable:ClientGroup_Resource" ZOrder="12" X="197" Y="766" Height="156" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:Job" ZOrder="3" X="-374" Y="215" Height="343" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="22" OldDataTableHeight="0" SplitterPosition="228" />
+    <Shape ID="DesignTable:JobResult" ZOrder="11" X="146" Y="172" Height="90" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="0" />
+    <Shape ID="DesignTable:RequiredPlugins" ZOrder="8" X="-498" Y="629" Height="105" Width="235" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:PluginInfo" ZOrder="6" X="-454" Y="759" Height="105" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="22" OldDataTableHeight="0" SplitterPosition="58" />
   </Shapes>
   <Connectors>
@@ -33,5 +33,5 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:ClientGroup_is_a_Resource" ZOrder="13" LineWidth="11">
+    <Connector ID="DesignRelation:ClientGroup_is_a_Resource" ZOrder="14" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -41,21 +41,9 @@
         <Point>
           <X>377</X>
-          <Y>607</Y>
+          <Y>589</Y>
         </Point>
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_52" ZOrder="9" LineWidth="11">
-      <RoutePoints>
-        <Point>
-          <X>312</X>
-          <Y>713</Y>
-        </Point>
-        <Point>
-          <X>312</X>
-          <Y>765</Y>
-        </Point>
-      </RoutePoints>
-    </Connector>
-    <Connector ID="DesignRelation:R_21" ZOrder="8" LineWidth="11">
+    <Connector ID="DesignRelation:R_21" ZOrder="10" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -73,5 +61,5 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_14" ZOrder="7" LineWidth="11">
+    <Connector ID="DesignRelation:R_14" ZOrder="9" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -89,5 +77,5 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_51" ZOrder="5" LineWidth="11">
+    <Connector ID="DesignRelation:R_51" ZOrder="7" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -101,5 +89,5 @@
       </RoutePoints>
     </Connector>
-    <Connector ID="DesignRelation:R_54" ZOrder="3" LineWidth="11">
+    <Connector ID="DesignRelation:R_54" ZOrder="5" LineWidth="11">
       <RoutePoints>
         <Point>
@@ -113,4 +101,16 @@
       </RoutePoints>
     </Connector>
+    <Connector ID="DesignRelation:R_52" ZOrder="1" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>312</X>
+          <Y>504</Y>
+        </Point>
+        <Point>
+          <X>312</X>
+          <Y>766</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
   </Connectors>
 </DiagramLayout>
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs	(revision 1514)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs	(revision 1515)
@@ -68,70 +68,89 @@
       clients = clientAdapter.GetAll();
       Debug.Assert(count - 1 == clients.Count);
+    } */
+
+    private void TestClientGroupAdapter() {
+      ISessionFactory factory =
+        ServiceLocator.GetSessionFactory();
+
+      ISession session =
+        factory.GetSessionForCurrentThread();
+
+      ITransaction trans = null;
+
+      try {
+        IClientGroupAdapter clientGroupAdapter =
+        session.GetDataAdapter<ClientGroup, IClientGroupAdapter>();
+
+        trans =
+          session.BeginTransaction();
+
+        ClientInfo client =
+          new ClientInfo();
+        client.Name = "Stefan";
+        client.Login = DateTime.Now;
+
+        ClientInfo client2 =
+          new ClientInfo();
+        client2.Name = "Martin";
+        client2.Login = DateTime.Now;
+
+        ClientInfo client3 =
+          new ClientInfo();
+        client3.Name = "Heinz";
+        client3.Login = DateTime.Now;
+
+        ClientGroup group =
+          new ClientGroup();
+
+        ClientGroup subGroup =
+          new ClientGroup();
+        subGroup.Resources.Add(client);
+
+        group.Resources.Add(client3);
+        group.Resources.Add(client2);
+        group.Resources.Add(subGroup);
+
+        clientGroupAdapter.Update(group);
+
+        ClientGroup read =
+          clientGroupAdapter.GetById(group.Id);
+
+        ICollection<ClientGroup> clientGroups =
+          clientGroupAdapter.GetAll();
+
+        IClientAdapter clientAdapter =
+          session.GetDataAdapter<ClientInfo, IClientAdapter>();
+
+        clientAdapter.Delete(client3);
+
+        read =
+           clientGroupAdapter.GetById(group.Id);
+
+        clientGroupAdapter.Delete(subGroup);
+
+        read =
+           clientGroupAdapter.GetById(group.Id);
+
+        clientGroups =
+          clientGroupAdapter.GetAll();
+
+        clientGroupAdapter.Delete(group);
+
+        clientGroups =
+          clientGroupAdapter.GetAll();
+
+        clientAdapter.Delete(client);
+        clientAdapter.Delete(client2);
+      }
+      finally {
+        if (trans != null)
+          trans.Rollback();
+
+        session.EndSession();
+      }
     }
 
-    private void TestClientGroupAdapter() {
-      IClientGroupAdapter clientGroupAdapter =
-       ServiceLocator.GetClientGroupAdapter();
-
-      ClientInfo client =
-        new ClientInfo();
-      client.Name = "Stefan";
-      client.Login = DateTime.Now;
-
-      ClientInfo client2 =
-        new ClientInfo();
-      client2.Name = "Martin";
-      client2.Login = DateTime.Now;
-
-      ClientInfo client3 =
-        new ClientInfo();
-      client3.Name = "Heinz";
-      client3.Login = DateTime.Now;
-
-      ClientGroup group =
-        new ClientGroup();
-
-      ClientGroup subGroup =
-        new ClientGroup();
-      subGroup.Resources.Add(client);
-
-      group.Resources.Add(client3);
-      group.Resources.Add(client2);
-      group.Resources.Add(subGroup);
-
-      clientGroupAdapter.Update(group);
-
-      ClientGroup read =
-        clientGroupAdapter.GetById(group.Id);
-
-      ICollection<ClientGroup> clientGroups =
-        clientGroupAdapter.GetAll();
-
-      IClientAdapter clientAdapter =
-        ServiceLocator.GetClientAdapter();
-
-      clientAdapter.Delete(client3);
-
-      read =
-         clientGroupAdapter.GetById(group.Id);
-
-      clientGroupAdapter.Delete(subGroup);
-
-      read =
-         clientGroupAdapter.GetById(group.Id);
-
-      clientGroups =
-        clientGroupAdapter.GetAll();
-
-      clientGroupAdapter.Delete(group);
-
-      clientGroups =
-        clientGroupAdapter.GetAll();
-
-      clientAdapter.Delete(client);
-      clientAdapter.Delete(client2);
-    }
-
-    private void TestJobAdapter() {
+   /* private void TestJobAdapter() {
       IJobAdapter jobAdapter = 
         ServiceLocator.GetJobAdapter();
@@ -201,16 +220,16 @@
     }      */
 
-    public override void Run() {
+    private void TestTransaction() {
       ISessionFactory factory =
         ServiceLocator.GetSessionFactory();
 
-      ISession session = 
+      ISession session =
         factory.GetSessionForCurrentThread();
 
-      IClientAdapter clientAdapter = 
+      IClientAdapter clientAdapter =
         session.GetDataAdapter<ClientInfo, IClientAdapter>();
 
-      ITransaction trans = 
-        session.BeginTransaction(); 
+      ITransaction trans =
+        session.BeginTransaction();
 
       ClientInfo client = new ClientInfo();
@@ -221,4 +240,8 @@
 
       session.EndSession();
+    }
+
+    public override void Run() {
+      TestClientGroupAdapter();
     }      
   }
