Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs	(revision 3931)
@@ -326,6 +326,6 @@
     #region Heartbeat
 
-    public event System.EventHandler<ProcessHeartBeatCompletedEventArgs> SendHeartBeatCompleted;
-    public void SendHeartBeatAsync(HeartBeatData hbd) {
+    public event System.EventHandler<ProcessHeartBeatCompletedEventArgs> ProcessHeartBeatCompleted;
+    public void ProcessHeartBeatAsync(HeartBeatData hbd) {
       if (ConnState == NetworkEnum.WcfConnState.Loggedin)
         Logger.Debug("STARTING: sending heartbeat");
@@ -334,6 +334,6 @@
 
     private void proxy_ProcessHeartBeatCompleted(object sender, ProcessHeartBeatCompletedEventArgs e) {
-      if (e.Error == null && e.Result.Success == true) {
-        SendHeartBeatCompleted(sender, e);
+      if (e.Error == null && e.Result.Success) {
+        ProcessHeartBeatCompleted(sender, e);
         Logger.Debug("ENDED: sending heartbeats");
       } else {
@@ -376,5 +376,5 @@
     }
 
-    public ResponseResultReceived SendStoredJobResultsSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {      
+    public ResponseResultReceived StoreFinishedJobResultsSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {      
       return proxy.StoreFinishedJobResultStreamed(
         GetStreamedJobResult(clientId, jobId, result, percentage, exception));
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/HeuristicLab.Hive.Client.Console-3.2.csproj
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/HeuristicLab.Hive.Client.Console-3.2.csproj	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/HeuristicLab.Hive.Client.Console-3.2.csproj	(revision 3931)
@@ -202,6 +202,4 @@
     <None Include="Properties\DataSources\Calendar.Appointment.datasource" />
     <None Include="Resources\shutdown-icon.png" />
-    <None Include="Service References\ClientService\Calendar.xsd" />
-    <None Include="Service References\ClientService\System.Drawing.xsd" />
   </ItemGroup>
   <ItemGroup>
@@ -213,4 +211,6 @@
   <ItemGroup>
     <None Include="Resources\exit-48.png" />
+    <None Include="Service References\ClientService\Calendar1.xsd" />
+    <None Include="Service References\ClientService\System.Drawing1.xsd" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/HiveClientConsole.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/HiveClientConsole.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/HiveClientConsole.cs	(revision 3931)
@@ -187,5 +187,5 @@
     }
 
-    private void UpdateGraph(JobStatus[] jobs)
+    private void UpdateGraph(StatusCommons sc)
     {
       ZedGraphControl zgc = new ZedGraphControl();
@@ -208,5 +208,6 @@
       double done = 0;
 
-      if (jobs.Length == 0)
+      
+      /*if (jobs.Length == 0)
       {
         myPane.AddPieSlice(100, Color.Green, 0.1, "");
@@ -217,11 +218,11 @@
         {
           allProgress += jobs[i].Progress;
-        }
-
-        done = allProgress / jobs.Length;
-
-        myPane.AddPieSlice(done, Color.Green, 0, "");
-        myPane.AddPieSlice(1 - done, Color.Red, 0, "");
-      }
+        } */
+
+        //done = allProgress / jobs.Length;
+
+      myPane.AddPieSlice((sc.FreeCores / (double) sc.TotalCores), Color.Red, 0, "");
+      myPane.AddPieSlice(((sc.TotalCores - sc.FreeCores) / (double)sc.TotalCores), Color.Green, 0, "");
+     // }
       //Hides the slice labels
       PieItem.Default.LabelType = PieLabelType.None;
@@ -586,5 +587,5 @@
         }
 
-        UpdateGraph(sc.Jobs);
+        UpdateGraph(sc);
 
         if (sc.Status == NetworkEnumWcfConnState.Connected || sc.Status == NetworkEnumWcfConnState.Loggedin)
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/HeuristicLab.Hive.Client.Core.ClientConsoleService.xsd
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/HeuristicLab.Hive.Client.Core.ClientConsoleService.xsd	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/HeuristicLab.Hive.Client.Core.ClientConsoleService.xsd	(revision 3931)
@@ -7,4 +7,5 @@
       <xs:element minOccurs="0" name="ClientGuid" type="ser:guid" />
       <xs:element minOccurs="0" name="ConnectedSince" type="xs:dateTime" />
+      <xs:element minOccurs="0" name="FreeCores" type="xs:int" />
       <xs:element minOccurs="0" name="Jobs" nillable="true" type="tns:ArrayOfJobStatus" />
       <xs:element minOccurs="0" name="JobsAborted" type="xs:int" />
@@ -12,4 +13,5 @@
       <xs:element minOccurs="0" name="JobsFetched" type="xs:int" />
       <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/HeuristicLab.Hive.Client.Common" minOccurs="0" name="Status" type="q1:NetworkEnum.WcfConnState" />
+      <xs:element minOccurs="0" name="TotalCores" type="xs:int" />
     </xs:sequence>
   </xs:complexType>
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/Reference.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/Reference.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/Reference.cs	(revision 3931)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3082
+//     Runtime Version:2.0.50727.4927
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
@@ -31,4 +31,7 @@
         
         [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private int FreeCoresField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
         private HeuristicLab.Hive.Client.Console.ClientService.JobStatus[] JobsField;
         
@@ -44,4 +47,7 @@
         [System.Runtime.Serialization.OptionalFieldAttribute()]
         private HeuristicLab.Hive.Client.Console.ClientService.NetworkEnumWcfConnState StatusField;
+        
+        [System.Runtime.Serialization.OptionalFieldAttribute()]
+        private int TotalCoresField;
         
         [global::System.ComponentModel.BrowsableAttribute(false)]
@@ -82,4 +88,17 @@
         
         [System.Runtime.Serialization.DataMemberAttribute()]
+        public int FreeCores {
+            get {
+                return this.FreeCoresField;
+            }
+            set {
+                if ((this.FreeCoresField.Equals(value) != true)) {
+                    this.FreeCoresField = value;
+                    this.RaisePropertyChanged("FreeCores");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
         public HeuristicLab.Hive.Client.Console.ClientService.JobStatus[] Jobs {
             get {
@@ -142,4 +161,17 @@
                     this.StatusField = value;
                     this.RaisePropertyChanged("Status");
+                }
+            }
+        }
+        
+        [System.Runtime.Serialization.DataMemberAttribute()]
+        public int TotalCores {
+            get {
+                return this.TotalCoresField;
+            }
+            set {
+                if ((this.TotalCoresField.Equals(value) != true)) {
+                    this.TotalCoresField = value;
+                    this.RaisePropertyChanged("TotalCores");
                 }
             }
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/Reference.svcmap
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/Reference.svcmap	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/Reference.svcmap	(revision 3931)
@@ -26,6 +26,6 @@
     <MetadataFile FileName="HeuristicLab.Hive.Client.Core.ClientConsoleService.xsd" MetadataType="Schema" ID="36748734-59b6-4ba4-950d-66ca1a4fc8bb" SourceId="1" SourceUrl="net.tcp://127.0.0.1:8000/ClientConsole/mex" />
     <MetadataFile FileName="HeuristicLab.Hive.Client.Common.xsd" MetadataType="Schema" ID="0c1369fa-d4cc-4149-b202-00da9dd35972" SourceId="1" SourceUrl="net.tcp://127.0.0.1:8000/ClientConsole/mex" />
-    <MetadataFile FileName="Calendar.xsd" MetadataType="Schema" ID="09fa9f67-e082-4dcb-9c41-a7a3f0fb7aef" SourceId="1" SourceUrl="net.tcp://127.0.0.1:8000/ClientConsole/mex" />
-    <MetadataFile FileName="System.Drawing.xsd" MetadataType="Schema" ID="70cfc9bf-b4a8-419b-8c1f-379c0d78f9d2" SourceId="1" SourceUrl="net.tcp://127.0.0.1:8000/ClientConsole/mex" />
+    <MetadataFile FileName="Calendar1.xsd" MetadataType="Schema" ID="5ec19e4e-fed1-451d-971e-01b8df8dcb0a" SourceId="1" SourceUrl="net.tcp://127.0.0.1:8000/ClientConsole/mex" />
+    <MetadataFile FileName="System.Drawing1.xsd" MetadataType="Schema" ID="2aa97a8b-a12e-47ca-8bb7-93a3404f40e5" SourceId="1" SourceUrl="net.tcp://127.0.0.1:8000/ClientConsole/mex" />
   </Metadata>
   <Extensions>
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/configuration.svcinfo
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/configuration.svcinfo	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/configuration.svcinfo	(revision 3931)
@@ -6,5 +6,5 @@
   </bindings>
   <endpoints>
-    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator&quot; binding=&quot;netTcpBinding&quot; bindingConfiguration=&quot;NetTcpBinding_IClientConsoleCommunicator&quot; contract=&quot;ClientService.IClientConsoleCommunicator&quot; name=&quot;NetTcpBinding_IClientConsoleCommunicator&quot;&gt;&lt;identity&gt;&lt;userPrincipalName value=&quot;mse08004@fhs-hagenberg.ac.at&quot; /&gt;&lt;/identity&gt;&lt;/Data&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator&quot; binding=&quot;netTcpBinding&quot; bindingConfiguration=&quot;NetTcpBinding_IClientConsoleCommunicator&quot; contract=&quot;ClientService.IClientConsoleCommunicator&quot; name=&quot;NetTcpBinding_IClientConsoleCommunicator&quot;&gt;&lt;identity&gt;&lt;userPrincipalName value=&quot;mse08004@fhs-hagenberg.ac.at&quot; /&gt;&lt;/identity&gt;&lt;/Data&gt;" contractName="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator" />
+    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator&quot; binding=&quot;netTcpBinding&quot; bindingConfiguration=&quot;NetTcpBinding_IClientConsoleCommunicator&quot; contract=&quot;ClientService.IClientConsoleCommunicator&quot; name=&quot;NetTcpBinding_IClientConsoleCommunicator&quot;&gt;&lt;identity&gt;&lt;userPrincipalName value=&quot;semteX-PC\semteX&quot; /&gt;&lt;/identity&gt;&lt;/Data&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator&quot; binding=&quot;netTcpBinding&quot; bindingConfiguration=&quot;NetTcpBinding_IClientConsoleCommunicator&quot; contract=&quot;ClientService.IClientConsoleCommunicator&quot; name=&quot;NetTcpBinding_IClientConsoleCommunicator&quot;&gt;&lt;identity&gt;&lt;userPrincipalName value=&quot;semteX-PC\semteX&quot; /&gt;&lt;/identity&gt;&lt;/Data&gt;" contractName="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator" />
   </endpoints>
 </configurationSnapshot>
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/configuration91.svcinfo
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/configuration91.svcinfo	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/configuration91.svcinfo	(revision 3931)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
-<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="LJHqHAg9UO+arib7mQMPUcNSFqQ=">
+<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="BEhVTwOR+7957ZuwDJOXr3mn9MQ=">
   <bindingConfigurations>
     <bindingConfiguration bindingType="netTcpBinding" name="NetTcpBinding_IClientConsoleCommunicator">
@@ -93,4 +93,16 @@
         <property path="/security/transport/protectionLevel" isComplexType="false" isExplicitlyDefined="true" clrType="System.Net.Security.ProtectionLevel, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
           <serializedValue>EncryptAndSign</serializedValue>
+        </property>
+        <property path="/security/transport/extendedProtectionPolicy" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+          <serializedValue>System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement</serializedValue>
+        </property>
+        <property path="/security/transport/extendedProtectionPolicy/policyEnforcement" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.PolicyEnforcement, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+          <serializedValue>Never</serializedValue>
+        </property>
+        <property path="/security/transport/extendedProtectionPolicy/protectionScenario" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.ProtectionScenario, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+          <serializedValue>TransportSelected</serializedValue>
+        </property>
+        <property path="/security/transport/extendedProtectionPolicy/customServiceNames" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+          <serializedValue>(Collection)</serializedValue>
         </property>
         <property path="/security/message" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.MessageSecurityOverTcpElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -137,5 +149,5 @@
         </property>
         <property path="/identity/userPrincipalName/value" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-          <serializedValue>mse08004@fhs-hagenberg.ac.at</serializedValue>
+          <serializedValue>semteX-PC\semteX</serializedValue>
         </property>
         <property path="/identity/servicePrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.ServicePrincipalNameElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/service.wsdl
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/service.wsdl	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/Service References/ClientService/service.wsdl	(revision 3931)
@@ -1,4 +1,4 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:tns="http://tempuri.org/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="ClientConsoleCommunicator" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:tns="http://tempuri.org/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="ClientConsoleCommunicator" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <wsp:Policy wsu:Id="NetTcpBinding_IClientConsoleCommunicator_policy">
     <wsp:ExactlyOne>
@@ -190,5 +190,5 @@
         <wsa10:Address>net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator</wsa10:Address>
         <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
-          <Upn>mse08004@fhs-hagenberg.ac.at</Upn>
+          <Upn>semteX-PC\semteX</Upn>
         </Identity>
       </wsa10:EndpointReference>
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/app.config
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/app.config	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Console/3.2/app.config	(revision 3931)
@@ -27,5 +27,7 @@
                                           enabled="false" />
                                    <security mode="Transport">
-                                          <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
+                                          <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign">
+                                                 <extendedProtectionPolicy policyEnforcement="Never" />
+                                          </transport>
                                           <message clientCredentialType="Windows" />
                                    </security>
@@ -38,5 +40,5 @@
                             contract="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator">
                             <identity>
-                                   <userPrincipalName value="mse08004@fhs-hagenberg.ac.at" />
+                                   <userPrincipalName value="semteX-PC\semteX" />
                             </identity>
                      </endpoint>
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/ClientConsoleService/TransferObjects/StatusCommons.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/ClientConsoleService/TransferObjects/StatusCommons.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/ClientConsoleService/TransferObjects/StatusCommons.cs	(revision 3931)
@@ -40,4 +40,8 @@
     public DateTime ConnectedSince { get; set; }
     [DataMember]
+    public int TotalCores { get; set; }
+    [DataMember]
+    public int FreeCores { get; set; }
+    [DataMember]
     public int JobsFetched { get; set; }
     [DataMember]
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/ConfigurationManager/ConfigManager.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/ConfigurationManager/ConfigManager.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/ConfigurationManager/ConfigManager.cs	(revision 3931)
@@ -108,4 +108,7 @@
       st.ConnectedSince = WcfService.Instance.ConnectedSince;
 
+      st.TotalCores = hardwareInfo.NrOfCores;
+      st.FreeCores = hardwareInfo.NrOfCores - GetUsedCores();
+
       st.JobsAborted = ClientStatusInfo.JobsAborted;
       st.JobsDone = ClientStatusInfo.JobsProcessed;
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs	(revision 3931)
@@ -259,4 +259,8 @@
           lock (engines) {
             appDomains[jId].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
+            
+            //Disposing it
+            engines[jId].Dispose();
+            
             AppDomain.Unload(appDomains[jId]);
             Logger.Debug("Unloaded appdomain");
@@ -478,4 +482,5 @@
       lock (engines) {
         try {
+          engines[id].Dispose();  
           appDomains[id].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
           AppDomain.Unload(appDomains[id]);
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Heartbeat.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Heartbeat.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Heartbeat.cs	(revision 3931)
@@ -65,5 +65,5 @@
       heartbeatTimer.Elapsed += new ElapsedEventHandler(heartbeatTimer_Elapsed);
       wcfService = WcfService.Instance;
-      wcfService.SendHeartBeatCompleted += new EventHandler<ProcessHeartBeatCompletedEventArgs>(wcfService_ProcessHeartBeatCompleted);
+      wcfService.ProcessHeartBeatCompleted += new EventHandler<ProcessHeartBeatCompletedEventArgs>(wcfService_ProcessHeartBeatCompleted);
       heartbeatTimer.Start();
     }
@@ -105,5 +105,5 @@
       } else if (wcfService.ConnState == NetworkEnum.WcfConnState.Loggedin) {
         Logger.Debug("Sending Heartbeat: " + heartBeatData);        
-        wcfService.SendHeartBeatAsync(heartBeatData);
+        wcfService.ProcessHeartBeatAsync(heartBeatData);
       }
     }
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/JobStorage/JobStorageManager.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/JobStorage/JobStorageManager.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/JobStorage/JobStorageManager.cs	(revision 3931)
@@ -1,3 +1,3 @@
-﻿using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -51,5 +51,5 @@
             byte[] job = File.ReadAllBytes(path + filename + ".dat");
             if (WcfService.Instance.IsJobStillNeeded(storedJobsList[index - 1].JobID).StatusMessage == ApplicationConstants.RESPONSE_COMMUNICATOR_SEND_JOBRESULT) {
-              ResponseResultReceived res = WcfService.Instance.SendStoredJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, storedJobsList[index - 1].JobID, job, 1.00, null, true);
+              ResponseResultReceived res = WcfService.Instance.StoreFinishedJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, storedJobsList[index - 1].JobID, job, 1.00, null, true);
               if (!res.Success)
                 Logger.Error("sending of job failed: " + res.StatusMessage);
Index: /branches/3.2/sources/HeuristicLab.Hive.Client.ExecutionEngine/3.2/Executor.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Client.ExecutionEngine/3.2/Executor.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Client.ExecutionEngine/3.2/Executor.cs	(revision 3931)
@@ -33,5 +33,5 @@
 
 namespace HeuristicLab.Hive.Client.ExecutionEngine {
-  public class Executor: MarshalByRefObject {
+  public class Executor: MarshalByRefObject, IDisposable {
     public Guid JobId { get; set; }
     public IJob Job { get; set; }
@@ -109,7 +109,8 @@
         throw new InvalidStateException("Job is still running");
       } else {
-        return SerializeJobObject();
+        byte[] jobArr = SerializeJobObject();        
+        return jobArr;
       }
-    }
+    }    
 
 
@@ -131,5 +132,16 @@
       JobIsFinished = false;
       Job = new TestJob();
-    }    
+    }
+
+    #region IDisposable Members
+
+    public void Dispose() {
+      Job.JobFailed -= new EventHandler(Job_JobFailed);
+      Job.JobFailed -= new EventHandler(Job_JobStopped);
+      Queue = null;
+      Job = null;
+    }
+
+    #endregion
   }
 }
Index: /branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs	(revision 3931)
@@ -29,8 +29,8 @@
   public class ApplicationConstants {
 
-    public static System.Data.IsolationLevel ISOLATION_LEVEL = IsolationLevel.ReadCommitted;
+    public static System.Data.IsolationLevel ISOLATION_LEVEL = IsolationLevel.ReadUncommitted;
 
     public static System.Transactions.IsolationLevel ISOLATION_LEVEL_SCOPE =
-      System.Transactions.IsolationLevel.ReadCommitted;
+      System.Transactions.IsolationLevel.ReadUncommitted;
     public static int HEARTBEAT_MAX_DIF = 120; // value in seconds
     public static int JOB_TIME_TO_LIVE = 5;
Index: /branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/ClientDto.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/ClientDto.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/ClientDto.cs	(revision 3931)
@@ -39,5 +39,5 @@
     public int NrOfFreeCores { get; set; }
     [DataMember]
-    public int CpuSpeedPerCore { get; set; }
+    public int? CpuSpeedPerCore { get; set; }
     [DataMember]
     public int Memory { get; set; }
@@ -45,5 +45,5 @@
     public int FreeMemory { get; set; }
     [DataMember]
-    public DateTime Login { get; set; }
+    public DateTime? Login { get; set; }
     [DataMember]
     public State State { get; set; }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ClientAdapter.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ClientAdapter.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ClientAdapter.cs	(revision 3931)
@@ -156,7 +156,7 @@
       if (client != null && row != null) {
         row.ResourceId = client.Id;
-        row.CPUSpeed = client.CpuSpeedPerCore;
+       // row.CPUSpeed = client.CpuSpeedPerCore;
         row.Memory = client.Memory;
-        row.Login = client.Login;
+       // row.Login = client.Login;
         if (client.State != State.nullState)
           row.Status = client.State.ToString();
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HeuristicLab.Hive.Server.Console-3.2.csproj
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HeuristicLab.Hive.Server.Console-3.2.csproj	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HeuristicLab.Hive.Server.Console-3.2.csproj	(revision 3931)
@@ -217,4 +217,8 @@
       <Name>HeuristicLab.PluginInfrastructure</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj">
+      <Project>{EE2034D9-6E27-48A1-B855-42D45F69A4FC}</Project>
+      <Name>HeuristicLab.Tracing-3.2</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs	(revision 3931)
@@ -33,4 +33,5 @@
 using System.Threading;
 using System.ServiceModel;
+using HeuristicLab.Tracing;
 
 namespace HeuristicLab.Hive.Server.ServerConsole {
@@ -263,7 +264,13 @@
         IJobManager jobManager =
           ServiceLocator.GetJobManager();
-        jobs = jobManager.GetAllJobs();
-
-        lvJobControl.Items.Clear();
+        if (jobManager == null) {
+          Logger.Error("Jobmanager is null");
+          jobs = new ResponseList<JobDto>();
+        } else {
+          jobs = jobManager.GetAllJobs();
+        }
+
+
+        if (lvJobControl != null) lvJobControl.Items.Clear();
 
         ListViewGroup lvJobCalculating = new ListViewGroup("calculating", HorizontalAlignment.Left);
@@ -311,4 +318,5 @@
       }
       catch (Exception ex) {
+        Logger.Error(ex);
         closeFormEvent(true, true);
         this.Close();
@@ -790,5 +798,5 @@
     }
 
-    private int CapacityRam(int noCores, int freeCores) {
+    private int CapacityRam(int noCores, int freeCores) {    
       if (noCores > 0) {
         int capacity = ((noCores - freeCores) / noCores) * 100;
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs	(revision 3931)
@@ -120,5 +120,5 @@
                 Logger.Info("Client timed out and is on RESET");
                 foreach (JobDto job in DaoLocator.JobDao.FindActiveJobsOfClient(client)) {
-                  jobManager.ResetJobsDependingOnResults(job);
+                  DaoLocator.JobDao.SetJobOffline(job);
                   lock (newAssignedJobs) {
                     if (newAssignedJobs.ContainsKey(job.Id))
@@ -149,5 +149,5 @@
               lastHeartbeats.Remove(client.Id);
             foreach (JobDto job in DaoLocator.JobDao.FindActiveJobsOfClient(client)) {
-              jobManager.ResetJobsDependingOnResults(job);
+              DaoLocator.JobDao.SetJobOffline(job);
             }
             heartbeatLock.ExitWriteLock();
@@ -428,5 +428,5 @@
       JobDto job2Calculate = scheduler.GetNextJobForClient(clientId);
       if (job2Calculate != null) {
-        response.Job = job2Calculate;
+        response.Job = job2Calculate;        
         response.Job.PluginsNeeded = DaoLocator.PluginInfoDao.GetPluginDependenciesForJob(response.Job);
         response.Success = true;
@@ -481,14 +481,27 @@
 
       if (response.Success) {
-        jobStream = DaoLocator.JobDao.GetSerializedJobStream(result.JobId);
-
+        Logger.Debug("Trying to aquire WCF Job Stream");
+        //jobStream = DaoLocator.JobDao.GetSerializedJobStream(result.JobId);
+        //Logger.Debug("Job Stream Aquired");
         byte[] buffer = new byte[3024];
+        List<byte> serializedJob = new List<byte>();
         int read = 0;
-        while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) {
-          jobStream.Write(buffer, 0, read);
-        }
-        jobStream.Close();
+        int i = 0;        
+        while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) {          
+          for (int j = 0; j < read; j++) {
+            serializedJob.Add(buffer[j]);
+          }
+          if (i% 100 == 0)
+            Logger.Debug("Writing to stream: " + i);         
+          //jobStream.Write(buffer, 0, read);
+          i++;
+        }
+        Logger.Debug("Done Writing, closing the stream!");               
+        //jobStream.Close();
+
+        DaoLocator.JobDao.SetBinaryJobFile(result.JobId, serializedJob.ToArray());
       }
       Logger.Info("END Job received for Storage:");
+      stream.Dispose();
       return response;
     }
@@ -656,5 +669,5 @@
         foreach (JobDto job in jobsOfClient) {
           if (job.State != State.finished)
-            jobManager.ResetJobsDependingOnResults(job);
+            DaoLocator.JobDao.SetJobOffline(job);
         }
       }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientFacade.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientFacade.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientFacade.cs	(revision 3931)
@@ -114,12 +114,10 @@
       IJobManager jobManager = 
         ServiceLocator.GetJobManager();
-
+      IInternalJobManager internalJobManager = (IInternalJobManager) jobManager;
+      
       //second stream the job binary data
-      
+      MemoryStream memoryStream = new MemoryStream();      
       if(job.Job != null)
-        stream.AddStream(
-          ((IInternalJobManager) (jobManager)).
-            GetJobStreamById(
-            job.Job.Id));
+        stream.AddStream(new MemoryStream(internalJobManager.GetSerializedJobDataById(job.Job.Id)));
       
       OperationContext clientContext = OperationContext.Current;
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/DbTestApp.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/DbTestApp.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/DbTestApp.cs	(revision 3931)
@@ -1,3 +1,4 @@
 ﻿#region License Information
+
 /* HeuristicLab
  * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
@@ -18,4 +19,5 @@
  * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #endregion
 
@@ -37,8 +39,10 @@
 using HeuristicLab.Hive.Server.LINQDataAccess;
 using System.Transactions;
+using System.Threading;
+using HeuristicLab.Tracing;
 
 namespace HeuristicLab.Hive.Server {
   [Application("Hive DB Test App", "Test Application for the Hive DataAccess Layer")]
-  class HiveDbTestApplication : ApplicationBase {
+  internal class HiveDbTestApplication : ApplicationBase {
     /*private void TestJobStreaming() {
       ISessionFactory factory =
@@ -111,10 +115,8 @@
     } */
 
-    ClientDao clientDao = new ClientDao();
-    ClientGroupDao cgd = new ClientGroupDao();
-
-    private void TestLINQImplementation() {      
-      
-      
+    private ClientDao clientDao = new ClientDao();
+    private ClientGroupDao cgd = new ClientGroupDao();
+
+    private void TestLINQImplementation() {
       ClientDto c1 = new ClientDto();
       c1.Id = Guid.NewGuid();
@@ -143,7 +145,4 @@
       c2 = clientDao.Insert(c2);
 
-      //ClientDto info2 = clientDao.FindById(info.Id);
-      //Console.WriteLine(info2);
-      
       ClientGroupDto tg = new ClientGroupDto();
       tg.Name = "TopGroup";
@@ -174,5 +173,5 @@
 
       List<ClientGroupDto> list = new List<ClientGroupDto>(cgd.FindAllWithSubGroupsAndClients());
-      
+
       cgd.RemoveRessourceFromClientGroup(sg.Id, tg.Id);
 
@@ -181,5 +180,4 @@
       clientDao.Delete(c1);
       clientDao.Delete(c2);
-
     }
 
@@ -220,10 +218,7 @@
         sg = cgd.Insert(sg);
         cgd.AddRessourceToClientGroup(sg.Id, mg.Id);
-        populateMainGroup(sg, p-1);
-      }
-
-      
-    }
-
+        populateMainGroup(sg, p - 1);
+      }
+    }
 
 
@@ -235,29 +230,115 @@
       //TestJobResultDeserialization();
 
+      //if (ContextFactory.Context.DatabaseExists())
+      //  ContextFactory.Context.DeleteDatabase();
+      //ContextFactory.Context.CreateDatabase();
       //TestLINQImplementation();
+      TestLinqFileHandling();
       //StressTest();
 
       //SpeedTest();
       //TestJobBytearrFetching();
-      TestJobStreamFetching();
-
-    }
-
-    private void TestJobStreamFetching() {
+      //TestJobStreamFetching();
+    }
+
+    private void WriteToJobWithByte(object jobid) {
+      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
+                                                           new TransactionOptions
+                                                           {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})
+        ) {
+        Logger.Info("starting bytestuff for job " + jobid);
+        DaoLocator.JobDao.SetBinaryJobFile((Guid)jobid, jobmap[(Guid)jobid]);
+        scope.Complete();
+        Logger.Info("ended bytestuff for job " + jobid);
+      }
+    }
+
+    private void UpdateJobStatus(object jobid) {
+      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
+                                                           new TransactionOptions
+                                                           {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})
+        ) {
+        Thread.Sleep(1500);
+        Logger.Info("starting now");
+        JobDto job = DaoLocator.JobDao.FindById((Guid)jobid);
+        job.Percentage = new Random().NextDouble();
+        DaoLocator.JobDao.Update(job);
+        scope.Complete();
+        Logger.Info("ended");
+      }
+    }
+
+    Dictionary<Guid, byte[]> jobmap = new Dictionary<Guid, byte[]>();
+
+
+    private void TestLinqFileHandling() {
+      List<Thread> jobupdateThreads = new List<Thread>();
+      List<Thread> jobProgressThreads = new List<Thread>();
+      
+      Random r = new Random();
+      Stack<JobDto> jobs = new Stack<JobDto>(DaoLocator.JobDao.FindAll());
+      Logger.Info("Fetched jobs");
+      for (int x = 0; x < 10 && jobs.Count > 0; x++ ) {
+        Logger.Info("Creating data for Job");
+        JobDto job = jobs.Pop();
+        byte[] jobarr = new byte[50*1024*1024];
+        for (int i = 0; i < jobarr.Length; i++) {
+          jobarr[i] = (byte) r.Next(255);
+        }
+        jobmap.Add(job.Id, jobarr);
+      }
+      Logger.Info("filled");
+      foreach(KeyValuePair<Guid, byte[]> kvp in jobmap) {
+        Thread tjob = new Thread(new ParameterizedThreadStart(WriteToJobWithByte));      
+        Thread tupdate = new Thread(new ParameterizedThreadStart(UpdateJobStatus));
+        jobupdateThreads.Add(tupdate);
+        jobProgressThreads.Add(tjob);
+        tupdate.Start(kvp.Key);
+        tjob.Start(kvp.Key);
+      }
+      foreach (Thread t in jobupdateThreads) {
+        t.Join();
+      }
+      foreach (Thread t in jobProgressThreads) {
+        t.Join();
+      }
+    }
+
+
+    private
+      void TestJobStreamFetching() {
       //using (TransactionScope scope = new TransactionScope()) {
+
       HiveDataContext context = ContextFactory.Context;
 
-      ContextFactory.Context.Connection.Open();
-      ContextFactory.Context.Transaction = ContextFactory.Context.Connection.BeginTransaction();
-      
+      ContextFactory.Context.Connection.Open
+        ();
+      ContextFactory.Context.Transaction
+        =
+        ContextFactory.Context.Connection.BeginTransaction
+          ();
+
+
       ClientFacade facade = new ClientFacade();
+
       Stream stream = facade.SendStreamedJob(new Guid("F5CFB334-66A0-417C-A585-71711BA21D3F"));
-      
+
+
       byte[] buffer = new byte[3024];
+
       int read = 0;
-      
-      while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) {}
-      
-      stream.Close();
+
+      while ((
+               read
+               =
+               stream.Read
+                 (
+                 buffer
+                 , 0,
+                 buffer.Length
+                 )) > 0) {}
+
+      stream.Close
+        ();
 
       //Stream stream = DaoLocator.JobDao.GetSerializedJobStream(new Guid("bbb51f87-4e2f-4499-a9b6-884e589c78b6"));
@@ -265,18 +346,27 @@
     }
 
-    private void TestJobBytearrFetching() {
+    private
+      void TestJobBytearrFetching() {
       byte[] arr = DaoLocator.JobDao.GetBinaryJobFile(new Guid("A3386907-2B3C-4976-BE07-04D660D40A5B"));
-      Console.WriteLine(arr);
-    }
-
-    private void SpeedTest() {
+      Console.WriteLine
+        (
+        arr
+        );
+    }
+
+    private
+      void SpeedTest() {
       DateTime start = new DateTime();
+
       List<ClientGroupDto> list = new List<ClientGroupDto>(cgd.FindAllWithSubGroupsAndClients());
+
       DateTime end = new DateTime();
+
       TimeSpan used = end - start;
-      Console.WriteLine(used.TotalMilliseconds);
-    }
-
-
+      Console.WriteLine
+        (
+        used.TotalMilliseconds
+        );
+    }
   }
 }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/InternalInterfaces/IInternalJobManager.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/InternalInterfaces/IInternalJobManager.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/InternalInterfaces/IInternalJobManager.cs	(revision 3931)
@@ -28,8 +28,8 @@
 
 namespace HeuristicLab.Hive.Server.Core.InternalInterfaces {
-  interface IInternalJobManager {
-    void ResetJobsDependingOnResults(JobDto job);
-
+  interface IInternalJobManager {   
     Stream GetJobStreamById(Guid jobId);
+    byte[] GetSerializedJobDataById(Guid jobId);
+    void SetSerializedJobDataById(Guid jobId, byte[] data);
   }
 }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs	(revision 3931)
@@ -1,3 +1,4 @@
 ﻿#region License Information
+
 /* HeuristicLab
  * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
@@ -18,4 +19,5 @@
  * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #endregion
 
@@ -38,8 +40,7 @@
 
 namespace HeuristicLab.Hive.Server.Core {
-  class JobManager: IJobManager, IInternalJobManager {
-
+  internal class JobManager : IJobManager, IInternalJobManager {
     //ISessionFactory factory;
-    ILifecycleManager lifecycleManager;
+    private ILifecycleManager lifecycleManager;
 
     #region IJobManager Members
@@ -53,23 +54,19 @@
     }
 
-    private JobDto GetLastJobResult(Guid jobId) {     
+    private JobDto GetLastJobResult(Guid jobId) {
       return DaoLocator.JobDao.FindById(jobId);
     }
 
-    public void ResetJobsDependingOnResults(JobDto job) {
-      Logger.Info("Setting job " + job.Id + " offline");
-      if (job != null) {
-        DaoLocator.JobDao.SetJobOffline(job);
-      }
-    }
-         
-
-    void checkForDeadJobs() {
+
+    private void checkForDeadJobs() {
       Logger.Info("Searching for dead Jobs");
-      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
+      using (
+        TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
+                                                      new TransactionOptions
+                                                      {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})) {
         List<JobDto> allJobs = new List<JobDto>(DaoLocator.JobDao.FindAll());
         foreach (JobDto curJob in allJobs) {
-          if (curJob.State != State.calculating) {
-            ResetJobsDependingOnResults(curJob);
+          if (curJob.State != State.calculating && curJob.State != State.finished) {
+            DaoLocator.JobDao.SetJobOffline(curJob);
           }
         }
@@ -79,10 +76,14 @@
     }
 
-    void lifecycleManager_OnStartup(object sender, EventArgs e) {
+    private void lifecycleManager_OnStartup(object sender, EventArgs e) {
+      Logger.Info("Startup Event Fired, Checking DB for consistency");
       checkForDeadJobs();
-    }
-
-    void lifecycleManager_OnShutdown(object sender, EventArgs e) {
+      Logger.Info("Startup Event Done");
+    }
+
+    private void lifecycleManager_OnShutdown(object sender, EventArgs e) {
+      Logger.Info("Startup Event Fired, Checking DB for consistency");
       checkForDeadJobs();
+      Logger.Info("Startup Event Done");
     }
 
@@ -92,11 +93,11 @@
     /// <returns></returns>
     public ResponseList<JobDto> GetAllJobs() {
-         ResponseList<JobDto> response = new ResponseList<JobDto>();
-
-         response.List = new List<JobDto>(DaoLocator.JobDao.FindAll());
-         response.Success = true;
-         response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ALL_JOBS;
-
-         return response;
+      ResponseList<JobDto> response = new ResponseList<JobDto>();
+
+      response.List = new List<JobDto>(DaoLocator.JobDao.FindAll());
+      response.Success = true;
+      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ALL_JOBS;
+
+      return response;
     }
 
@@ -105,5 +106,5 @@
       response.List = new List<JobDto>(DaoLocator.JobDao.FindWithLimitations(jobState, offset, count));
       return response;
-    }  
+    }
 
     /// <summary>
@@ -112,7 +113,6 @@
     /// <param name="jobId"></param>
     /// <returns></returns>
-    public Stream GetJobStreamById(Guid jobId) {           
+    public Stream GetJobStreamById(Guid jobId) {
       return DaoLocator.JobDao.GetSerializedJobStream(jobId);
-      
     }
 
@@ -122,17 +122,18 @@
     /// <returns></returns>
     public ResponseObject<JobDto> GetJobById(Guid jobId) {
-        ResponseObject<JobDto> response = new ResponseObject<JobDto>();
+      ResponseObject<JobDto> response = new ResponseObject<JobDto>();
 
       response.Obj = DaoLocator.JobDao.FindById(jobId);
-        if (response.Obj != null) {
-          response.Success = true;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_GET_JOB_BY_ID;
-        } else {
-          response.Success = false;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
-        }
-
-        return response;
-      }
+      if (response.Obj != null) {
+        response.Success = true;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_GET_JOB_BY_ID;
+      }
+      else {
+        response.Success = false;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
+      }
+
+      return response;
+    }
 
     public ResponseObject<JobDto> GetJobByIdWithDetails(Guid jobId) {
@@ -144,8 +145,9 @@
 
         job.Obj.Client = DaoLocator.ClientDao.GetClientForJob(jobId);
-      } else {
+      }
+      else {
         job.Success = false;
         job.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
-      }      
+      }
       return job;
     }
@@ -154,5 +156,5 @@
       IClientGroupDao cgd = DaoLocator.ClientGroupDao;
       foreach (string res in resources) {
-        foreach(ClientGroupDto cg in cgd.FindByName(res)) {
+        foreach (ClientGroupDto cg in cgd.FindByName(res)) {
           job.JobInfo.AssignedResourceIds.Add(cg.Id);
         }
@@ -167,63 +169,59 @@
     /// <returns></returns>
     public ResponseObject<JobDto> AddNewJob(SerializedJob job) {
-        ResponseObject<JobDto> response = new ResponseObject<JobDto>();
-
-        if (job != null && job.JobInfo != null) {
-          if (job.JobInfo.State != State.offline) {
-            response.Success = false;
-            response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOBSTATE_MUST_BE_OFFLINE;
-            return response;
-          }
-          if (job.JobInfo.Id != Guid.Empty) {
-            response.Success = false;
-            response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ID_MUST_NOT_BE_SET;
-            return response;
-          }
-          if (job.SerializedJobData == null) {
-            response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_NULL;
-            response.Success = false;
-            return response;
-          }
-
-          job.JobInfo.DateCreated = DateTime.Now;
-          DaoLocator.JobDao.InsertWithAttachedJob(job);
-          DaoLocator.PluginInfoDao.InsertPluginDependenciesForJob(job.JobInfo);
-          
-          response.Success = true;
-          response.Obj = job.JobInfo;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_ADDED;
-        } else {
+      ResponseObject<JobDto> response = new ResponseObject<JobDto>();
+
+      if (job != null && job.JobInfo != null) {
+        if (job.JobInfo.State != State.offline) {
           response.Success = false;
+          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOBSTATE_MUST_BE_OFFLINE;
+          return response;
+        }
+        if (job.JobInfo.Id != Guid.Empty) {
+          response.Success = false;
+          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ID_MUST_NOT_BE_SET;
+          return response;
+        }
+        if (job.SerializedJobData == null) {
           response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_NULL;
-        }
-
+          response.Success = false;
+          return response;
+        }
+
+        job.JobInfo.DateCreated = DateTime.Now;
+        DaoLocator.JobDao.InsertWithAttachedJob(job);
+        DaoLocator.PluginInfoDao.InsertPluginDependenciesForJob(job.JobInfo);
+
+        response.Success = true;
+        response.Obj = job.JobInfo;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_ADDED;
+      }
+      else {
+        response.Success = false;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_NULL;
+      }
+
+      return response;
+    }
+
+    /// <summary>
+    /// Removes a job from the database
+    /// </summary>
+    /// <param name="jobId"></param>
+    /// <returns></returns>
+    public Response RemoveJob(Guid jobId) {
+      Response response = new Response();
+
+      JobDto job = DaoLocator.JobDao.FindById(jobId);
+      if (job == null) {
+        response.Success = false;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
         return response;
       }
-    /*  finally {
-        if (session != null)
-          session.EndSession();
-      }
-    } */
-
-    /// <summary>
-    /// Removes a job from the database
-    /// </summary>
-    /// <param name="jobId"></param>
-    /// <returns></returns>
-    public Response RemoveJob(Guid jobId) {
-        Response response = new Response();
-
-      JobDto job = DaoLocator.JobDao.FindById(jobId);
-        if (job == null) {
-          response.Success = false;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
-          return response;
-        }
-        DaoLocator.JobDao.Delete(job);
-        response.Success = false;
-        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_REMOVED;
-
-        return response;
-      }
+      DaoLocator.JobDao.Delete(job);
+      response.Success = false;
+      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_REMOVED;
+
+      return response;
+    }
 
     public ResponseObject<JobDto> GetLastJobResultOf(Guid jobId) {
@@ -231,128 +229,88 @@
         new ResponseObject<JobDto>();
 
-       result.Obj =
-         GetLastJobResult(jobId);
-       result.Success =
-         result.Obj != null;
-
-       return result;
+      result.Obj =
+        GetLastJobResult(jobId);
+      result.Success =
+        result.Obj != null;
+
+      return result;
     }
 
     public ResponseObject<SerializedJob>
       GetLastSerializedJobResultOf(Guid jobId, bool requested) {
-
-        ResponseObject<SerializedJob> response =
-          new ResponseObject<SerializedJob>();
+      ResponseObject<SerializedJob> response =
+        new ResponseObject<SerializedJob>();
 
       JobDto job = DaoLocator.JobDao.FindById(jobId);
-        if (requested && (job.State == State.requestSnapshot || job.State == State.requestSnapshotSent)) {
-          response.Success = true;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE;
-          
-          //tx.Commit();
-          
-          return response;
-        }
-
-        /*JobResult lastResult =
-          jobResultsAdapter.GetLastResultOf(job.Id);*/
-
-        //if (lastResult != null) {
-          response.Success = true;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_RESULT_SENT;
-          response.Obj = new SerializedJob();
-          response.Obj.JobInfo = job;
-          response.Obj.SerializedJobData =
-            DaoLocator.JobDao.GetBinaryJobFile(jobId);
-        //} else {
-        //  response.Success = false;
-        //}
-
-        //tx.Commit();
+      if (requested && (job.State == State.requestSnapshot || job.State == State.requestSnapshotSent)) {
+        response.Success = true;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE;
+
         return response;
       }
-      /*catch (Exception ex) {
-        if (tx != null)
-          tx.Rollback();
-        throw ex;
-      }
-      finally {
-        if (session != null)
-          session.EndSession();
-      }
-    }    */
+
+      response.Success = true;
+      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_RESULT_SENT;
+      response.Obj = new SerializedJob();
+      response.Obj.JobInfo = job;
+      response.Obj.SerializedJobData =
+        DaoLocator.JobDao.GetBinaryJobFile(jobId);
+      return response;
+    }
 
 
     public Response RequestSnapshot(Guid jobId) {
-     // ISession session = factory.GetSessionForCurrentThread();
       Response response = new Response();
-      
-     /* try {
-        IJobAdapter jobAdapter = session.GetDataAdapter<JobDto, IJobAdapter>();*/
-
-        JobDto job = DaoLocator.JobDao.FindById(jobId);
-        if (job.State == State.requestSnapshot || job.State == State.requestSnapshotSent) {
-          response.Success = true;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_REQUEST_ALLREADY_SET;
-          return response; // no commit needed
-        }
-        if (job.State != State.calculating) {
-          response.Success = false;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED;
-          return response; // no commit needed
-        }
-        // job is in correct state
-        job.State = State.requestSnapshot;
-        DaoLocator.JobDao.Update(job);
-
-        response.Success = true;
-        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_REQUEST_SET;
-
+
+
+      JobDto job = DaoLocator.JobDao.FindById(jobId);
+      if (job.State == State.requestSnapshot || job.State == State.requestSnapshotSent) {
+        response.Success = true;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_REQUEST_ALLREADY_SET;
         return response;
       }
-    /*  finally {
-        if (session != null)
-          session.EndSession();
-      }
-    } */
+      if (job.State != State.calculating) {
+        response.Success = false;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED;
+        return response;
+      }
+      // job is in correct state
+      job.State = State.requestSnapshot;
+      DaoLocator.JobDao.Update(job);
+
+      response.Success = true;
+      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_REQUEST_SET;
+
+      return response;
+    }
 
     public Response AbortJob(Guid jobId) {
-      //ISession session = factory.GetSessionForCurrentThread();
       Response response = new Response();
 
-    /*  try {
-        IJobAdapter jobAdapter = session.GetDataAdapter<JobDto, IJobAdapter>();*/
-
-//        JobDto job = jobAdapter.GetById(jobId);
       JobDto job = DaoLocator.JobDao.FindById(jobId);
-        if (job == null) {
-          response.Success = false;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
-          return response; // no commit needed
-        }
-        if (job.State == State.abort) {
-          response.Success = true;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ABORT_REQUEST_ALLREADY_SET;
-          return response; // no commit needed
-        }
-        if (job.State != State.calculating && job.State != State.requestSnapshot && job.State != State.requestSnapshotSent) {
-          response.Success = false;
-          response.StatusMessage = ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED;
-          return response; // no commit needed
-        }
-        // job is in correct state
-        job.State = State.abort;
+      if (job == null) {
+        response.Success = false;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
+        return response; // no commit needed
+      }
+      if (job.State == State.abort) {
+        response.Success = true;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ABORT_REQUEST_ALLREADY_SET;
+        return response; // no commit needed
+      }
+      if (job.State != State.calculating && job.State != State.requestSnapshot && job.State != State.requestSnapshotSent) {
+        response.Success = false;
+        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED;
+        return response; // no commit needed
+      }
+      // job is in correct state
+      job.State = State.abort;
       DaoLocator.JobDao.Update(job);
 
-        response.Success = true;
-        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ABORT_REQUEST_SET;
-
-        return response;
-      }
-      /*finally {
-        if (session != null)
-          session.EndSession();
-      }
-    }   */
+      response.Success = true;
+      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_ABORT_REQUEST_SET;
+
+      return response;
+    }
 
     public ResponseList<JobResult> GetAllJobResults(Guid jobId) {
@@ -381,6 +339,15 @@
 
     public ResponseList<JobDto> GetJobsByProject(Guid projectId) {
-      return null;      
-    }
+      return null;
+    }
+
+    public byte[] GetSerializedJobDataById(Guid jobId) {
+      return DaoLocator.JobDao.GetBinaryJobFile(jobId);
+    }
+
+    public void SetSerializedJobDataById(Guid jobId, byte[] data) {
+      DaoLocator.JobDao.SetBinaryJobFile(jobId, data);
+    }
+
     #endregion
   }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.DataAccess/3.2/IJobDao.cs	(revision 3931)
@@ -23,4 +23,6 @@
 
     IEnumerable<JobDto> FindWithLimitations(State jobState, int offset, int count);
+
+    void SetBinaryJobFile(Guid jobId, byte[] data);
   }
 }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/BaseDao.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/BaseDao.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/BaseDao.cs	(revision 3931)
@@ -15,11 +15,20 @@
 
     protected void CommitChanges() {
+      //TODO: DoWhile
       try {
         Context.SubmitChanges(ConflictMode.ContinueOnConflict);
       } catch (ChangeConflictException e) {
         Logger.Warn("Concurrency Exception! " + e.Message);
-        foreach (ObjectChangeConflict conflict in Context.ChangeConflicts) {          
+        foreach (ObjectChangeConflict conflict in Context.ChangeConflicts) { 
+          Logger.Info("Conflicted: ");
+          foreach (MemberChangeConflict memberChangeConflict in conflict.MemberConflicts) {
+            Logger.Info("    Member in Conflict: " + memberChangeConflict.Member.Name);
+            Logger.Info("    Database Value: " + memberChangeConflict.DatabaseValue);
+            Logger.Info("    Original value: " + memberChangeConflict.OriginalValue);
+            Logger.Info("    Current value: " + memberChangeConflict.CurrentValue);              
+          }
           conflict.Resolve(RefreshMode.KeepChanges);
         }
+        Context.SubmitChanges(ConflictMode.FailOnFirstConflict);
       }
     }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientDao.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientDao.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientDao.cs	(revision 3931)
@@ -14,5 +14,5 @@
 
     public ClientDto FindById(Guid id) {
-      return (from client in Context.Clients
+      return (from client in Context.Resources.OfType<Client>()                         
               where client.ResourceId.Equals(id)
               select EntityToDto(client, null)
@@ -21,5 +21,5 @@
 
     public IEnumerable<ClientDto> FindAll() {
-      return (from client in Context.Clients
+      return (from client in Context.Resources.OfType<Client>()
               select
                 EntityToDto(client, null)
@@ -28,6 +28,6 @@
 
     public IEnumerable<ClientDto> FindAllClientsWithoutGroup() {
-      return (from client in Context.Clients
-              where client.Resource.ClientGroup_Resources.Count == 0
+      return (from client in Context.Resources.OfType<Client>()
+              where client.ClientGroup_Resources_Parents.Count == 0
               select EntityToDto(client, null)).ToList();
     }
@@ -40,5 +40,5 @@
 
     public void SetServerSideCalendar(ClientDto client, Guid clientGroupId) {
-      Client dbclient = Context.Clients.SingleOrDefault(c => c.ResourceId.Equals(client.Id));
+      Client dbclient = Context.Resources.OfType<Client>().SingleOrDefault(c => c.ResourceId.Equals(client.Id));
       dbclient.UseCalendarFromResourceId = clientGroupId;
       dbclient.CalendarSyncStatus = Enum.GetName(typeof(CalendarState), CalendarState.Fetch);
@@ -48,5 +48,5 @@
     public ClientDto Insert(ClientDto info) {
       Client c = DtoToEntity(info, null);      
-      Context.Clients.InsertOnSubmit(c);
+      Context.Resources.InsertOnSubmit(c);
       CommitChanges();
       info.Id = c.ResourceId;
@@ -62,5 +62,5 @@
 
     public void Update(ClientDto info) {
-      Client client = Context.Clients.SingleOrDefault(c => c.ResourceId.Equals(info.Id));
+      Client client = Context.Resources.OfType<Client>().SingleOrDefault(c => c.ResourceId.Equals(info.Id));
       DtoToEntity(info, client);
       CommitChanges();      
@@ -75,10 +75,7 @@
       target.CPUSpeed = source.CpuSpeedPerCore;
       
-      if(target.Resource == null)
-        target.Resource = new Resource();
-
       target.FreeMemory = source.FreeMemory;
-      target.Resource.Name = source.Name;
-      target.Resource.ResourceId = source.Id;
+      target.Name = source.Name;
+      target.ResourceId = source.Id;
       target.CalendarSyncStatus = Enum.GetName(typeof(CalendarState), source.CalendarSyncStatus);
       target.Login = source.Login;
@@ -96,12 +93,12 @@
         target = new ClientDto();
       target.CpuSpeedPerCore = source.CPUSpeed;
-      target.FreeMemory = source.FreeMemory;
+      target.FreeMemory = source.FreeMemory ?? 0;
       target.Id = source.ResourceId;
       target.CalendarSyncStatus = (CalendarState) Enum.Parse(typeof (CalendarState), source.CalendarSyncStatus);
       target.Login = source.Login;
-      target.Memory = source.Memory;
-      target.Name = source.Resource.Name;
-      target.NrOfCores = source.NumberOfCores;
-      target.NrOfFreeCores = source.NumberOfFreeCores;
+      target.Memory = source.Memory ?? 0;
+      target.Name = source.Name;
+      target.NrOfCores = source.NumberOfCores ?? 0;
+      target.NrOfFreeCores = source.NumberOfFreeCores ?? 0;
       target.State = (State) Enum.Parse(typeof (State), source.Status);
       return target;
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ClientGroupDao.cs	(revision 3931)
@@ -13,5 +13,5 @@
 
     public ClientGroupDto FindById(Guid id) {
-      return (from cc in Context.ClientGroups
+      return (from cc in Context.Resources.OfType<ClientGroup>()
               where cc.ResourceId.Equals(id)
               select EntityToDto(cc, null)).SingleOrDefault();
@@ -20,5 +20,5 @@
 
     public IEnumerable<ClientGroupDto> FindAll() {
-      return (from cc in Context.ClientGroups
+      return (from cc in Context.Resources.OfType<ClientGroup>()
               select EntityToDto(cc, null)).ToList();
     }
@@ -30,5 +30,5 @@
 
       ClientGroup cc = DtoToEntity(bObj, null);
-      Context.ClientGroups.InsertOnSubmit(cc);
+      Context.Resources.InsertOnSubmit(cc);
       CommitChanges();
       bObj.Id = cc.ResourceId;
@@ -48,5 +48,5 @@
 
     public void Update(ClientGroupDto bObj) {
-      ClientGroup client = Context.ClientGroups.SingleOrDefault(c => c.ResourceId.Equals(bObj.Id));
+      ClientGroup client = Context.Resources.OfType<ClientGroup>().SingleOrDefault(c => c.ResourceId.Equals(bObj.Id));
       DtoToEntity(bObj, client);
       CommitChanges();
@@ -54,7 +54,7 @@
 
     public void AddRessourceToClientGroup(Guid resource, Guid clientGroupId) {
-      ClientGroup cg = Context.ClientGroups.SingleOrDefault(c => c.ResourceId.Equals(clientGroupId));
+      ClientGroup cg = Context.Resources.OfType<ClientGroup>().SingleOrDefault(c => c.ResourceId.Equals(clientGroupId));
       Resource res = Context.Resources.SingleOrDefault(r => r.ResourceId.Equals(resource));
-      cg.ClientGroup_Resources.Add(new ClientGroup_Resource { ClientGroup = cg, Resource = res });      
+      cg.ClientGroup_Resources_Children.Add(new ClientGroup_Resource { ClientGroup = cg, Resource = res });      
       CommitChanges();
     }
@@ -77,5 +77,5 @@
       List<ClientGroupDto> groupList = new List<ClientGroupDto>();
 
-      var q = (from cg in Context.ClientGroups
+      var q = (from cg in Context.Resources.OfType<ClientGroup>()
                where !Context.ClientGroup_Resources.Any(cgr => cgr.ResourceId.Equals(cg.ResourceId))
                select cg);
@@ -84,5 +84,5 @@
         ClientGroupDto cgd = EntityToDto(cg, null);
         groupList.Add(cgd);
-        FillSubGroupsAndClientsRecursivly(cgd, cg.ClientGroup_Resources);        
+        FillSubGroupsAndClientsRecursivly(cgd, cg.ClientGroup_Resources_Children);        
       }
       return groupList;
@@ -93,6 +93,6 @@
       //Get all the Groups
       
-      var qGroups = (from cg in Context.ClientGroups
-               where cg.Resource.ClientGroup_Resources.Any(cgr => cgr.ClientGroupId.Equals(parentClientGroup.Id))
+      var qGroups = (from cg in Context.Resources.OfType<ClientGroup>()
+               where cg.ClientGroup_Resources_Parents.Any(cgr => cgr.ClientGroupId.Equals(parentClientGroup.Id))
                select cg);
 
@@ -100,10 +100,10 @@
         ClientGroupDto cgd = EntityToDto(cg, null);
         parentClientGroup.Resources.Add(cgd);
-        FillSubGroupsAndClientsRecursivly(cgd, cg.ClientGroup_Resources);
+        FillSubGroupsAndClientsRecursivly(cgd, cg.ClientGroup_Resources_Children);
       }
 
       //get the clients
-      var qClients = (from cl in Context.Clients
-               where cl.Resource.ClientGroup_Resources.Any(cgr => cgr.ClientGroupId.Equals(parentClientGroup.Id))
+      var qClients = (from cl in Context.Resources.OfType<Client>()
+               where cl.ClientGroup_Resources_Parents.Any(cgr => cgr.ClientGroupId.Equals(parentClientGroup.Id))
                select cl);
       foreach (Client client in qClients) {
@@ -114,13 +114,14 @@
     public IEnumerable<Guid> FindAllGroupAndParentGroupIdsForClient(Guid clientId) {
       List<Guid> guids = new List<Guid>();
-      Client c = Context.Clients.SingleOrDefault(client => client.ResourceId.Equals(clientId));
-      FindAllGroupAndParentGroupIdsForClientRecursive(c.Resource, guids);
+      Client c = Context.Resources.OfType<Client>().SingleOrDefault(client => client.ResourceId.Equals(clientId));
+      FindAllGroupAndParentGroupIdsForClientRecursive(c, guids);
       return guids;
     }
 
+    //Massivly error Prone
     private void FindAllGroupAndParentGroupIdsForClientRecursive(Resource resource, List<Guid> guids) {
-      foreach (ClientGroup_Resource cgr in resource.ClientGroup_Resources) {
+      foreach (ClientGroup_Resource cgr in resource.ClientGroup_Resources_Parents) {
         guids.Add(cgr.ClientGroupId);
-        FindAllGroupAndParentGroupIdsForClientRecursive(cgr.ClientGroup.Resource, guids);        
+        FindAllGroupAndParentGroupIdsForClientRecursive(cgr.ClientGroup, guids);        
       }
     }
@@ -133,9 +134,7 @@
       if (target == null)
         target = new ClientGroup();
-      if (target.Resource == null)
-        target.Resource = new Resource();
 
-      target.Resource.Name = source.Name;
-      target.Resource.ResourceId = source.Id;
+      target.Name = source.Name;
+      target.ResourceId = source.Id;
 
       return target;
@@ -149,5 +148,5 @@
 
       target.Id = source.ResourceId;
-      target.Name = source.Resource.Name;
+      target.Name = source.Name;
 
       return target;
@@ -155,6 +154,6 @@
 
     public IEnumerable<ClientGroupDto> FindByName(string res) {
-      return (from cq in Context.ClientGroups
-              where cq.Resource.Name == res
+      return (from cq in Context.Resources.OfType<ClientGroup>()
+              where cq.Name == res
               select EntityToDto(cq, null)).ToList();      
     }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ContextFactory.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ContextFactory.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/ContextFactory.cs	(revision 3931)
@@ -5,4 +5,5 @@
 using System.Data.Common;
 using System.Data.SqlClient;
+using HeuristicLab.Tracing;
 
 namespace HeuristicLab.Hive.Server.LINQDataAccess {
@@ -16,6 +17,9 @@
     public static HiveDataContext Context { 
       get {
-        if(_hiveDataContext == null) 
-          _hiveDataContext = new HiveDataContext();
+        if (_hiveDataContext == null) {
+          Logger.Debug("Requested new Data Context");
+          _hiveDataContext = new HiveDataContext("Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq.Test;Integrated Security=SSPI");
+          _hiveDataContext.CommandTimeout = 240;
+        }
         return _hiveDataContext;        
       } 
@@ -32,4 +36,8 @@
       } 
     }
+
+    public static bool IsContextNull() {
+      return _hiveDataContext == null;
+    }
   }
 }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HeuristicLab.Hive.Server.LINQDataAccess-3.2.csproj
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HeuristicLab.Hive.Server.LINQDataAccess-3.2.csproj	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HeuristicLab.Hive.Server.LINQDataAccess-3.2.csproj	(revision 3931)
@@ -91,9 +91,5 @@
     <Compile Include="ClientGroupDao.cs" />
     <Compile Include="ContextFactory.cs" />
-    <Compile Include="Hive.designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>Hive.dbml</DependentUpon>
-    </Compile>
+    <Compile Include="HiveDataContext.cs" />
     <Compile Include="JobDao.cs" />
     <Compile Include="LINQDataAccessPlugin.cs" />
@@ -109,9 +105,4 @@
   </ItemGroup>
   <ItemGroup>
-    <None Include="Hive.dbml">
-      <Generator>MSLinqToSQLGenerator</Generator>
-      <LastGenOutput>Hive.designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </None>
     <None Include="HeuristicLab.snk" />
     <None Include="Properties\AssemblyInfo.frame" />
@@ -144,11 +135,11 @@
   <ItemGroup>
     <None Include="app.config" />
-    <None Include="Hive.dbml.layout">
-      <DependentUpon>Hive.dbml</DependentUpon>
-    </None>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="HiveDataContext.xml" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml	(revision 3931)
@@ -78,5 +78,4 @@
       <Association Name="Resource_UptimeCalendar" Member="UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeCalendar" />
       <Association Name="Resource_Client" Member="Client" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" Cardinality="One" />
-      <Association Name="Resource_Client1" Member="Client1" ThisKey="ResourceId" OtherKey="ResourceId" Type="Client" Cardinality="One" />
     </Type>
   </Table>
@@ -133,5 +132,4 @@
       <Association Name="Client_Job" Member="Jobs" ThisKey="ResourceId" OtherKey="ResourceId" Type="Job" />
       <Association Name="Resource_Client" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" DeleteOnNull="true" />
-      <Association Name="Resource_Client1" Member="Resource1" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
       <Association Name="ClientConfig_Client" Member="ClientConfig" ThisKey="ClientConfigId" OtherKey="ClientConfigId" Type="ClientConfig" IsForeignKey="true" DeleteRule="SET NULL" />
     </Type>
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.dbml.layout	(revision 3931)
@@ -166,11 +166,4 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(5.0625 : 6.94399251302083); (5.0625 : 8.25)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Client1" />
-      <nodes>
-        <classShapeMoniker Id="e44e8355-4290-42f0-8b46-4473e91e504b" />
-        <classShapeMoniker Id="51cb317e-413a-4e25-a9b6-e903322f0371" />
-      </nodes>
-    </associationConnector>
     <associationConnector edgePoints="[(4.75 : 12); (4.75 : 11.1747054036458)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/ClientConfig/ClientConfig_Client" />
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Hive.designer.cs	(revision 3931)
@@ -1512,6 +1512,4 @@
 		private EntityRef<Client> _Client;
 		
-		private EntityRef<Client> _Client1;
-		
     #region Extensibility Method Definitions
     partial void OnLoaded();
@@ -1531,5 +1529,4 @@
 			this._UptimeCalendars = new EntitySet<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
 			this._Client = default(EntityRef<Client>);
-			this._Client1 = default(EntityRef<Client>);
 			OnCreated();
 		}
@@ -1668,33 +1665,4 @@
 					}
 					this.SendPropertyChanged("Client");
-				}
-			}
-		}
-		
-		[Association(Name="Resource_Client1", Storage="_Client1", ThisKey="ResourceId", OtherKey="ResourceId", IsUnique=true, IsForeignKey=false)]
-		public Client Client1
-		{
-			get
-			{
-				return this._Client1.Entity;
-			}
-			set
-			{
-				Client previousValue = this._Client1.Entity;
-				if (((previousValue != value) 
-							|| (this._Client1.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Client1.Entity = null;
-						previousValue.Resource1 = null;
-					}
-					this._Client1.Entity = value;
-					if ((value != null))
-					{
-						value.Resource1 = this;
-					}
-					this.SendPropertyChanged("Client1");
 				}
 			}
@@ -2620,6 +2588,4 @@
 		private EntityRef<Resource> _Resource;
 		
-		private EntityRef<Resource> _Resource1;
-		
 		private EntityRef<ClientConfig> _ClientConfig;
 		
@@ -2657,5 +2623,4 @@
 			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
 			this._Resource = default(EntityRef<Resource>);
-			this._Resource1 = default(EntityRef<Resource>);
 			this._ClientConfig = default(EntityRef<ClientConfig>);
 			OnCreated();
@@ -2950,38 +2915,4 @@
 		}
 		
-		[Association(Name="Resource_Client1", Storage="_Resource1", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true)]
-		public Resource Resource1
-		{
-			get
-			{
-				return this._Resource1.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._Resource1.Entity;
-				if (((previousValue != value) 
-							|| (this._Resource1.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Resource1.Entity = null;
-						previousValue.Client1 = null;
-					}
-					this._Resource1.Entity = value;
-					if ((value != null))
-					{
-						value.Client1 = this;
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Resource1");
-				}
-			}
-		}
-		
 		[Association(Name="ClientConfig_Client", Storage="_ClientConfig", ThisKey="ClientConfigId", OtherKey="ClientConfigId", IsForeignKey=true, DeleteRule="SET NULL")]
 		public ClientConfig ClientConfig
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.cs	(revision 3931)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.cs	(revision 3931)
@@ -0,0 +1,2755 @@
+﻿#pragma warning disable 1591
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.4927
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Hive.Server.LINQDataAccess
+{
+	using System.Data.Linq;
+	using System.Data.Linq.Mapping;
+	using System.Data;
+	using System.Collections.Generic;
+	using System.Reflection;
+	using System.Linq;
+	using System.Linq.Expressions;
+	using System.ComponentModel;
+	using System;
+	
+	
+	[System.Data.Linq.Mapping.DatabaseAttribute(Name="HeuristicLab.Hive.Linq.Test")]
+	public partial class HiveDataContext : System.Data.Linq.DataContext
+	{
+		
+		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
+		
+    #region Extensibility Method Definitions
+    partial void OnCreated();
+    partial void InsertAssignedResource(AssignedResource instance);
+    partial void UpdateAssignedResource(AssignedResource instance);
+    partial void DeleteAssignedResource(AssignedResource instance);
+    partial void InsertUptimeStatistic(UptimeStatistic instance);
+    partial void UpdateUptimeStatistic(UptimeStatistic instance);
+    partial void DeleteUptimeStatistic(UptimeStatistic instance);
+    partial void InsertClientConfig(ClientConfig instance);
+    partial void UpdateClientConfig(ClientConfig instance);
+    partial void DeleteClientConfig(ClientConfig instance);
+    partial void InsertClientGroup_Resource(ClientGroup_Resource instance);
+    partial void UpdateClientGroup_Resource(ClientGroup_Resource instance);
+    partial void DeleteClientGroup_Resource(ClientGroup_Resource instance);
+    partial void InsertPluginInfo(PluginInfo instance);
+    partial void UpdatePluginInfo(PluginInfo instance);
+    partial void DeletePluginInfo(PluginInfo instance);
+    partial void InsertProject(Project instance);
+    partial void UpdateProject(Project instance);
+    partial void DeleteProject(Project instance);
+    partial void InsertRequiredPlugin(RequiredPlugin instance);
+    partial void UpdateRequiredPlugin(RequiredPlugin instance);
+    partial void DeleteRequiredPlugin(RequiredPlugin instance);
+    partial void InsertResource(Resource instance);
+    partial void UpdateResource(Resource instance);
+    partial void DeleteResource(Resource instance);
+    partial void InsertJob(Job instance);
+    partial void UpdateJob(Job instance);
+    partial void DeleteJob(Job instance);
+    partial void InsertUptimeCalendar(UptimeCalendar instance);
+    partial void UpdateUptimeCalendar(UptimeCalendar instance);
+    partial void DeleteUptimeCalendar(UptimeCalendar instance);
+    #endregion
+		
+		public HiveDataContext(string connection) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(System.Data.IDbConnection connection) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public HiveDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
+				base(connection, mappingSource)
+		{
+			OnCreated();
+		}
+		
+		public System.Data.Linq.Table<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this.GetTable<AssignedResource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<UptimeStatistic> UptimeStatistics
+		{
+			get
+			{
+				return this.GetTable<UptimeStatistic>();
+			}
+		}
+		
+		public System.Data.Linq.Table<ClientConfig> ClientConfigs
+		{
+			get
+			{
+				return this.GetTable<ClientConfig>();
+			}
+		}
+		
+		public System.Data.Linq.Table<ClientGroup_Resource> ClientGroup_Resources
+		{
+			get
+			{
+				return this.GetTable<ClientGroup_Resource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<PluginInfo> PluginInfos
+		{
+			get
+			{
+				return this.GetTable<PluginInfo>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Project> Projects
+		{
+			get
+			{
+				return this.GetTable<Project>();
+			}
+		}
+		
+		public System.Data.Linq.Table<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this.GetTable<RequiredPlugin>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Resource> Resources
+		{
+			get
+			{
+				return this.GetTable<Resource>();
+			}
+		}
+		
+		public System.Data.Linq.Table<Job> Jobs
+		{
+			get
+			{
+				return this.GetTable<Job>();
+			}
+		}
+		
+		public System.Data.Linq.Table<UptimeCalendar> UptimeCalendars
+		{
+			get
+			{
+				return this.GetTable<UptimeCalendar>();
+			}
+		}
+	}
+	
+	[Table(Name="dbo.AssignedResources")]
+	public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ResourceId;
+		
+		private System.Guid _JobId;
+		
+		private System.Guid _AssignedRessourcesId;
+		
+		private EntityRef<Resource> _Resource;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnAssignedRessourcesIdChanging(System.Guid value);
+    partial void OnAssignedRessourcesIdChanged();
+    #endregion
+		
+		public AssignedResource()
+		{
+			this._Resource = default(EntityRef<Resource>);
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_AssignedRessourcesId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid AssignedRessourcesId
+		{
+			get
+			{
+				return this._AssignedRessourcesId;
+			}
+			set
+			{
+				if ((this._AssignedRessourcesId != value))
+				{
+					this.OnAssignedRessourcesIdChanging(value);
+					this.SendPropertyChanging();
+					this._AssignedRessourcesId = value;
+					this.SendPropertyChanged("AssignedRessourcesId");
+					this.OnAssignedRessourcesIdChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Resource_AssignedResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.AssignedResources.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedResources.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		[Association(Name="Job_AssignedResource", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.AssignedResources.Remove(this);
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.AssignedResources.Add(this);
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[Table(Name="dbo.UptimeStatistics")]
+	public partial class UptimeStatistic : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _UptimeStatisticsId;
+		
+		private System.DateTime _Login;
+		
+		private System.DateTime _Logout;
+		
+		private System.Guid _ResourceId;
+		
+		private EntityRef<Client> _Client;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnUptimeStatisticsIdChanging(System.Guid value);
+    partial void OnUptimeStatisticsIdChanged();
+    partial void OnLoginChanging(System.DateTime value);
+    partial void OnLoginChanged();
+    partial void OnLogoutChanging(System.DateTime value);
+    partial void OnLogoutChanged();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    #endregion
+		
+		public UptimeStatistic()
+		{
+			this._Client = default(EntityRef<Client>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_UptimeStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid UptimeStatisticsId
+		{
+			get
+			{
+				return this._UptimeStatisticsId;
+			}
+			set
+			{
+				if ((this._UptimeStatisticsId != value))
+				{
+					this.OnUptimeStatisticsIdChanging(value);
+					this.SendPropertyChanging();
+					this._UptimeStatisticsId = value;
+					this.SendPropertyChanged("UptimeStatisticsId");
+					this.OnUptimeStatisticsIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Login", DbType="DateTime")]
+		public System.DateTime Login
+		{
+			get
+			{
+				return this._Login;
+			}
+			set
+			{
+				if ((this._Login != value))
+				{
+					this.OnLoginChanging(value);
+					this.SendPropertyChanging();
+					this._Login = value;
+					this.SendPropertyChanged("Login");
+					this.OnLoginChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Logout", DbType="DateTime")]
+		public System.DateTime Logout
+		{
+			get
+			{
+				return this._Logout;
+			}
+			set
+			{
+				if ((this._Logout != value))
+				{
+					this.OnLogoutChanging(value);
+					this.SendPropertyChanging();
+					this._Logout = value;
+					this.SendPropertyChanged("Logout");
+					this.OnLogoutChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Client.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Client_UptimeStatistic", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
+		public Client Client
+		{
+			get
+			{
+				return this._Client.Entity;
+			}
+			set
+			{
+				Client previousValue = this._Client.Entity;
+				if (((previousValue != value) 
+							|| (this._Client.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Client.Entity = null;
+						previousValue.UptimeStatistics.Remove(this);
+					}
+					this._Client.Entity = value;
+					if ((value != null))
+					{
+						value.UptimeStatistics.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Client");
+				}
+			}
+		}
+		
+		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));
+			}
+		}
+	}
+	
+	[Table(Name="dbo.ClientConfig")]
+	public partial class ClientConfig : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ClientConfigId;
+		
+		private System.Xml.Linq.XElement _UpDownTimeCalendar;
+		
+		private System.Nullable<int> _HeartBeatIntervall;
+		
+		private EntitySet<Client> _Clients;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnClientConfigIdChanging(System.Guid value);
+    partial void OnClientConfigIdChanged();
+    partial void OnUpDownTimeCalendarChanging(System.Xml.Linq.XElement value);
+    partial void OnUpDownTimeCalendarChanged();
+    partial void OnHeartBeatIntervallChanging(System.Nullable<int> value);
+    partial void OnHeartBeatIntervallChanged();
+    #endregion
+		
+		public ClientConfig()
+		{
+			this._Clients = new EntitySet<Client>(new Action<Client>(this.attach_Clients), new Action<Client>(this.detach_Clients));
+			OnCreated();
+		}
+		
+		[Column(Storage="_ClientConfigId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid ClientConfigId
+		{
+			get
+			{
+				return this._ClientConfigId;
+			}
+			set
+			{
+				if ((this._ClientConfigId != value))
+				{
+					this.OnClientConfigIdChanging(value);
+					this.SendPropertyChanging();
+					this._ClientConfigId = value;
+					this.SendPropertyChanged("ClientConfigId");
+					this.OnClientConfigIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_UpDownTimeCalendar", DbType="Xml", UpdateCheck=UpdateCheck.Never)]
+		public System.Xml.Linq.XElement UpDownTimeCalendar
+		{
+			get
+			{
+				return this._UpDownTimeCalendar;
+			}
+			set
+			{
+				if ((this._UpDownTimeCalendar != value))
+				{
+					this.OnUpDownTimeCalendarChanging(value);
+					this.SendPropertyChanging();
+					this._UpDownTimeCalendar = value;
+					this.SendPropertyChanged("UpDownTimeCalendar");
+					this.OnUpDownTimeCalendarChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_HeartBeatIntervall", DbType="Int")]
+		public System.Nullable<int> HeartBeatIntervall
+		{
+			get
+			{
+				return this._HeartBeatIntervall;
+			}
+			set
+			{
+				if ((this._HeartBeatIntervall != value))
+				{
+					this.OnHeartBeatIntervallChanging(value);
+					this.SendPropertyChanging();
+					this._HeartBeatIntervall = value;
+					this.SendPropertyChanged("HeartBeatIntervall");
+					this.OnHeartBeatIntervallChanged();
+				}
+			}
+		}
+		
+		[Association(Name="ClientConfig_Client", Storage="_Clients", ThisKey="ClientConfigId", OtherKey="ClientConfigId")]
+		public EntitySet<Client> Clients
+		{
+			get
+			{
+				return this._Clients;
+			}
+			set
+			{
+				this._Clients.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_Clients(Client entity)
+		{
+			this.SendPropertyChanging();
+			entity.ClientConfig = this;
+		}
+		
+		private void detach_Clients(Client entity)
+		{
+			this.SendPropertyChanging();
+			entity.ClientConfig = null;
+		}
+	}
+	
+	[Table(Name="dbo.ClientGroup_Resource")]
+	public partial class ClientGroup_Resource : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ClientGroup_RessourceId;
+		
+		private System.Guid _ClientGroupId;
+		
+		private System.Guid _ResourceId;
+		
+		private EntityRef<ClientGroup> _ClientGroup;
+		
+		private EntityRef<Resource> _Resource;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnClientGroup_RessourceIdChanging(System.Guid value);
+    partial void OnClientGroup_RessourceIdChanged();
+    partial void OnClientGroupIdChanging(System.Guid value);
+    partial void OnClientGroupIdChanged();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    #endregion
+		
+		public ClientGroup_Resource()
+		{
+			this._ClientGroup = default(EntityRef<ClientGroup>);
+			this._Resource = default(EntityRef<Resource>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_ClientGroup_RessourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid ClientGroup_RessourceId
+		{
+			get
+			{
+				return this._ClientGroup_RessourceId;
+			}
+			set
+			{
+				if ((this._ClientGroup_RessourceId != value))
+				{
+					this.OnClientGroup_RessourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ClientGroup_RessourceId = value;
+					this.SendPropertyChanged("ClientGroup_RessourceId");
+					this.OnClientGroup_RessourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ClientGroupId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid ClientGroupId
+		{
+			get
+			{
+				return this._ClientGroupId;
+			}
+			set
+			{
+				if ((this._ClientGroupId != value))
+				{
+					if (this._ClientGroup.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnClientGroupIdChanging(value);
+					this.SendPropertyChanging();
+					this._ClientGroupId = value;
+					this.SendPropertyChanged("ClientGroupId");
+					this.OnClientGroupIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Association(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup", ThisKey="ClientGroupId", OtherKey="ResourceId", IsForeignKey=true)]
+		public ClientGroup ClientGroup
+		{
+			get
+			{
+				return this._ClientGroup.Entity;
+			}
+			set
+			{
+				ClientGroup previousValue = this._ClientGroup.Entity;
+				if (((previousValue != value) 
+							|| (this._ClientGroup.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._ClientGroup.Entity = null;
+						previousValue.ClientGroup_Resources_Children.Remove(this);
+					}
+					this._ClientGroup.Entity = value;
+					if ((value != null))
+					{
+						value.ClientGroup_Resources_Children.Add(this);
+						this._ClientGroupId = value.ResourceId;
+					}
+					else
+					{
+						this._ClientGroupId = default(System.Guid);
+					}
+					this.SendPropertyChanged("ClientGroup");
+				}
+			}
+		}
+		
+		[Association(Name="Resource_ClientGroup_Resource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.ClientGroup_Resources_Parents.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.ClientGroup_Resources_Parents.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[Table(Name="dbo.PluginInfo")]
+	public partial class PluginInfo : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _PluginId;
+		
+		private string _Name;
+		
+		private string _Version;
+		
+		private string _BuildDate;
+		
+		private EntitySet<RequiredPlugin> _RequiredPlugins;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnPluginIdChanging(System.Guid value);
+    partial void OnPluginIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnVersionChanging(string value);
+    partial void OnVersionChanged();
+    partial void OnBuildDateChanging(string value);
+    partial void OnBuildDateChanged();
+    #endregion
+		
+		public PluginInfo()
+		{
+			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
+			OnCreated();
+		}
+		
+		[Column(Storage="_PluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid PluginId
+		{
+			get
+			{
+				return this._PluginId;
+			}
+			set
+			{
+				if ((this._PluginId != value))
+				{
+					this.OnPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._PluginId = value;
+					this.SendPropertyChanged("PluginId");
+					this.OnPluginIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Name", DbType="VarChar(MAX)")]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Version", DbType="VarChar(MAX)")]
+		public string Version
+		{
+			get
+			{
+				return this._Version;
+			}
+			set
+			{
+				if ((this._Version != value))
+				{
+					this.OnVersionChanging(value);
+					this.SendPropertyChanging();
+					this._Version = value;
+					this.SendPropertyChanged("Version");
+					this.OnVersionChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_BuildDate", DbType="VarChar(20)")]
+		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();
+				}
+			}
+		}
+		
+		[Association(Name="PluginInfo_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="PluginId", OtherKey="PluginId")]
+		public EntitySet<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this._RequiredPlugins;
+			}
+			set
+			{
+				this._RequiredPlugins.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.PluginInfo = this;
+		}
+		
+		private void detach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.PluginInfo = null;
+		}
+	}
+	
+	[Table(Name="dbo.Project")]
+	public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _ProjectId;
+		
+		private string _Name;
+		
+		private EntitySet<Job> _Jobs;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnProjectIdChanging(System.Guid value);
+    partial void OnProjectIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    #endregion
+		
+		public Project()
+		{
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			OnCreated();
+		}
+		
+		[Column(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Name", DbType="VarChar(MAX)")]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")]
+		public EntitySet<Job> Jobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Project = null;
+		}
+	}
+	
+	[Table(Name="dbo.RequiredPlugins")]
+	public partial class RequiredPlugin : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _RequiredPluginId;
+		
+		private System.Guid _JobId;
+		
+		private System.Guid _PluginId;
+		
+		private EntityRef<PluginInfo> _PluginInfo;
+		
+		private EntityRef<Job> _Job;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnRequiredPluginIdChanging(System.Guid value);
+    partial void OnRequiredPluginIdChanged();
+    partial void OnJobIdChanging(System.Guid value);
+    partial void OnJobIdChanged();
+    partial void OnPluginIdChanging(System.Guid value);
+    partial void OnPluginIdChanged();
+    #endregion
+		
+		public RequiredPlugin()
+		{
+			this._PluginInfo = default(EntityRef<PluginInfo>);
+			this._Job = default(EntityRef<Job>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_RequiredPluginId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
+		public System.Guid RequiredPluginId
+		{
+			get
+			{
+				return this._RequiredPluginId;
+			}
+			set
+			{
+				if ((this._RequiredPluginId != value))
+				{
+					this.OnRequiredPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._RequiredPluginId = value;
+					this.SendPropertyChanged("RequiredPluginId");
+					this.OnRequiredPluginIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_JobId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					if (this._Job.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_PluginId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid PluginId
+		{
+			get
+			{
+				return this._PluginId;
+			}
+			set
+			{
+				if ((this._PluginId != value))
+				{
+					if (this._PluginInfo.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnPluginIdChanging(value);
+					this.SendPropertyChanging();
+					this._PluginId = value;
+					this.SendPropertyChanged("PluginId");
+					this.OnPluginIdChanged();
+				}
+			}
+		}
+		
+		[Association(Name="PluginInfo_RequiredPlugin", Storage="_PluginInfo", ThisKey="PluginId", OtherKey="PluginId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public PluginInfo PluginInfo
+		{
+			get
+			{
+				return this._PluginInfo.Entity;
+			}
+			set
+			{
+				PluginInfo previousValue = this._PluginInfo.Entity;
+				if (((previousValue != value) 
+							|| (this._PluginInfo.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._PluginInfo.Entity = null;
+						previousValue.RequiredPlugins.Remove(this);
+					}
+					this._PluginInfo.Entity = value;
+					if ((value != null))
+					{
+						value.RequiredPlugins.Add(this);
+						this._PluginId = value.PluginId;
+					}
+					else
+					{
+						this._PluginId = default(System.Guid);
+					}
+					this.SendPropertyChanged("PluginInfo");
+				}
+			}
+		}
+		
+		[Association(Name="Job_RequiredPlugin", Storage="_Job", ThisKey="JobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job
+		{
+			get
+			{
+				return this._Job.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job.Entity;
+				if (((previousValue != value) 
+							|| (this._Job.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job.Entity = null;
+						previousValue.RequiredPlugins.Remove(this);
+					}
+					this._Job.Entity = value;
+					if ((value != null))
+					{
+						value.RequiredPlugins.Add(this);
+						this._JobId = value.JobId;
+					}
+					else
+					{
+						this._JobId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Job");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+	
+	[Table(Name="dbo.Resource")]
+	[InheritanceMapping(Code="RESOURCE", Type=typeof(Resource))]
+	[InheritanceMapping(Code="CLIENT", Type=typeof(Client), IsDefault=true)]
+	[InheritanceMapping(Code="GROUP", Type=typeof(ClientGroup))]
+	public partial class Resource : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		protected System.Guid _ResourceId;
+		
+		private string _Name;
+		
+		private string _ResourceType;
+		
+		private EntitySet<AssignedResource> _AssignedResources;
+		
+		private EntitySet<ClientGroup_Resource> _ClientGroup_Resources_Parents;
+		
+		private EntitySet<UptimeCalendar> _UptimeCalendars;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnNameChanging(string value);
+    partial void OnNameChanged();
+    partial void OnResourceTypeChanging(string value);
+    partial void OnResourceTypeChanged();
+    #endregion
+		
+		public Resource()
+		{
+			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
+			this._ClientGroup_Resources_Parents = new EntitySet<ClientGroup_Resource>(new Action<ClientGroup_Resource>(this.attach_ClientGroup_Resources_Parents), new Action<ClientGroup_Resource>(this.detach_ClientGroup_Resources_Parents));
+			this._UptimeCalendars = new EntitySet<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
+			OnCreated();
+		}
+		
+		[Column(Storage="_ResourceId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Name", DbType="VarChar(MAX)")]
+		public string Name
+		{
+			get
+			{
+				return this._Name;
+			}
+			set
+			{
+				if ((this._Name != value))
+				{
+					this.OnNameChanging(value);
+					this.SendPropertyChanging();
+					this._Name = value;
+					this.SendPropertyChanged("Name");
+					this.OnNameChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ResourceType", IsDiscriminator=true)]
+		public string ResourceType
+		{
+			get
+			{
+				return this._ResourceType;
+			}
+			set
+			{
+				if ((this._ResourceType != value))
+				{
+					this.OnResourceTypeChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceType = value;
+					this.SendPropertyChanged("ResourceType");
+					this.OnResourceTypeChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Resource_AssignedResource", Storage="_AssignedResources", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this._AssignedResources;
+			}
+			set
+			{
+				this._AssignedResources.Assign(value);
+			}
+		}
+		
+		[Association(Name="Resource_ClientGroup_Resource", Storage="_ClientGroup_Resources_Parents", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<ClientGroup_Resource> ClientGroup_Resources_Parents
+		{
+			get
+			{
+				return this._ClientGroup_Resources_Parents;
+			}
+			set
+			{
+				this._ClientGroup_Resources_Parents.Assign(value);
+			}
+		}
+		
+		[Association(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<UptimeCalendar> UptimeCalendars
+		{
+			get
+			{
+				return this._UptimeCalendars;
+			}
+			set
+			{
+				this._UptimeCalendars.Assign(value);
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = this;
+		}
+		
+		private void detach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = null;
+		}
+		
+		private void attach_ClientGroup_Resources_Parents(ClientGroup_Resource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = this;
+		}
+		
+		private void detach_ClientGroup_Resources_Parents(ClientGroup_Resource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = null;
+		}
+		
+		private void attach_UptimeCalendars(UptimeCalendar entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = this;
+		}
+		
+		private void detach_UptimeCalendars(UptimeCalendar entity)
+		{
+			this.SendPropertyChanging();
+			entity.Resource = null;
+		}
+	}
+	
+	public partial class Client : Resource
+	{
+		
+		private System.Nullable<int> _CPUSpeed;
+		
+		private System.Nullable<int> _Memory;
+		
+		private System.Nullable<System.DateTime> _Login;
+		
+		private string _Status;
+		
+		private string _CalendarSyncStatus;
+		
+		private System.Nullable<System.Guid> _UseCalendarFromResourceId;
+		
+		private System.Nullable<System.Guid> _ClientConfigId;
+		
+		private System.Nullable<int> _NumberOfCores;
+		
+		private System.Nullable<int> _NumberOfFreeCores;
+		
+		private System.Nullable<int> _FreeMemory;
+		
+		private EntitySet<UptimeStatistic> _UptimeStatistics;
+		
+		private EntitySet<Job> _Jobs;
+		
+		private EntityRef<ClientConfig> _ClientConfig;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnCPUSpeedChanging(System.Nullable<int> value);
+    partial void OnCPUSpeedChanged();
+    partial void OnMemoryChanging(System.Nullable<int> value);
+    partial void OnMemoryChanged();
+    partial void OnLoginChanging(System.Nullable<System.DateTime> value);
+    partial void OnLoginChanged();
+    partial void OnStatusChanging(string value);
+    partial void OnStatusChanged();
+    partial void OnCalendarSyncStatusChanging(string value);
+    partial void OnCalendarSyncStatusChanged();
+    partial void OnUseCalendarFromResourceIdChanging(System.Nullable<System.Guid> value);
+    partial void OnUseCalendarFromResourceIdChanged();
+    partial void OnClientConfigIdChanging(System.Nullable<System.Guid> value);
+    partial void OnClientConfigIdChanged();
+    partial void OnNumberOfCoresChanging(System.Nullable<int> value);
+    partial void OnNumberOfCoresChanged();
+    partial void OnNumberOfFreeCoresChanging(System.Nullable<int> value);
+    partial void OnNumberOfFreeCoresChanged();
+    partial void OnFreeMemoryChanging(System.Nullable<int> value);
+    partial void OnFreeMemoryChanged();
+    #endregion
+		
+		public Client()
+		{
+			this._UptimeStatistics = new EntitySet<UptimeStatistic>(new Action<UptimeStatistic>(this.attach_UptimeStatistics), new Action<UptimeStatistic>(this.detach_UptimeStatistics));
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._ClientConfig = default(EntityRef<ClientConfig>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_CPUSpeed", DbType="Int")]
+		public System.Nullable<int> CPUSpeed
+		{
+			get
+			{
+				return this._CPUSpeed;
+			}
+			set
+			{
+				if ((this._CPUSpeed != value))
+				{
+					this.OnCPUSpeedChanging(value);
+					this.SendPropertyChanging();
+					this._CPUSpeed = value;
+					this.SendPropertyChanged("CPUSpeed");
+					this.OnCPUSpeedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Memory", DbType="Int")]
+		public System.Nullable<int> Memory
+		{
+			get
+			{
+				return this._Memory;
+			}
+			set
+			{
+				if ((this._Memory != value))
+				{
+					this.OnMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._Memory = value;
+					this.SendPropertyChanged("Memory");
+					this.OnMemoryChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Login", DbType="DateTime")]
+		public System.Nullable<System.DateTime> Login
+		{
+			get
+			{
+				return this._Login;
+			}
+			set
+			{
+				if ((this._Login != value))
+				{
+					this.OnLoginChanging(value);
+					this.SendPropertyChanging();
+					this._Login = value;
+					this.SendPropertyChanged("Login");
+					this.OnLoginChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Status", DbType="VarChar(MAX)")]
+		public string Status
+		{
+			get
+			{
+				return this._Status;
+			}
+			set
+			{
+				if ((this._Status != value))
+				{
+					this.OnStatusChanging(value);
+					this.SendPropertyChanging();
+					this._Status = value;
+					this.SendPropertyChanged("Status");
+					this.OnStatusChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_CalendarSyncStatus", DbType="VarChar(MAX)")]
+		public string CalendarSyncStatus
+		{
+			get
+			{
+				return this._CalendarSyncStatus;
+			}
+			set
+			{
+				if ((this._CalendarSyncStatus != value))
+				{
+					this.OnCalendarSyncStatusChanging(value);
+					this.SendPropertyChanging();
+					this._CalendarSyncStatus = value;
+					this.SendPropertyChanged("CalendarSyncStatus");
+					this.OnCalendarSyncStatusChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_UseCalendarFromResourceId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> UseCalendarFromResourceId
+		{
+			get
+			{
+				return this._UseCalendarFromResourceId;
+			}
+			set
+			{
+				if ((this._UseCalendarFromResourceId != value))
+				{
+					this.OnUseCalendarFromResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._UseCalendarFromResourceId = value;
+					this.SendPropertyChanged("UseCalendarFromResourceId");
+					this.OnUseCalendarFromResourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ClientConfigId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ClientConfigId
+		{
+			get
+			{
+				return this._ClientConfigId;
+			}
+			set
+			{
+				if ((this._ClientConfigId != value))
+				{
+					if (this._ClientConfig.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnClientConfigIdChanging(value);
+					this.SendPropertyChanging();
+					this._ClientConfigId = value;
+					this.SendPropertyChanged("ClientConfigId");
+					this.OnClientConfigIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_NumberOfCores", DbType="Int")]
+		public System.Nullable<int> NumberOfCores
+		{
+			get
+			{
+				return this._NumberOfCores;
+			}
+			set
+			{
+				if ((this._NumberOfCores != value))
+				{
+					this.OnNumberOfCoresChanging(value);
+					this.SendPropertyChanging();
+					this._NumberOfCores = value;
+					this.SendPropertyChanged("NumberOfCores");
+					this.OnNumberOfCoresChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_NumberOfFreeCores", DbType="Int")]
+		public System.Nullable<int> NumberOfFreeCores
+		{
+			get
+			{
+				return this._NumberOfFreeCores;
+			}
+			set
+			{
+				if ((this._NumberOfFreeCores != value))
+				{
+					this.OnNumberOfFreeCoresChanging(value);
+					this.SendPropertyChanging();
+					this._NumberOfFreeCores = value;
+					this.SendPropertyChanged("NumberOfFreeCores");
+					this.OnNumberOfFreeCoresChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_FreeMemory", DbType="Int")]
+		public System.Nullable<int> FreeMemory
+		{
+			get
+			{
+				return this._FreeMemory;
+			}
+			set
+			{
+				if ((this._FreeMemory != value))
+				{
+					this.OnFreeMemoryChanging(value);
+					this.SendPropertyChanging();
+					this._FreeMemory = value;
+					this.SendPropertyChanged("FreeMemory");
+					this.OnFreeMemoryChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Client_UptimeStatistic", Storage="_UptimeStatistics", ThisKey="ResourceId", OtherKey="ResourceId")]
+		public EntitySet<UptimeStatistic> UptimeStatistics
+		{
+			get
+			{
+				return this._UptimeStatistics;
+			}
+			set
+			{
+				this._UptimeStatistics.Assign(value);
+			}
+		}
+		
+		[Association(Name="Client_Job", Storage="_Jobs", ThisKey="ResourceId", OtherKey="ResourceId", DeleteRule="SET NULL")]
+		public EntitySet<Job> Jobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		[Association(Name="ClientConfig_Client", Storage="_ClientConfig", ThisKey="ClientConfigId", OtherKey="ClientConfigId", IsForeignKey=true, DeleteRule="SET NULL")]
+		public ClientConfig ClientConfig
+		{
+			get
+			{
+				return this._ClientConfig.Entity;
+			}
+			set
+			{
+				ClientConfig previousValue = this._ClientConfig.Entity;
+				if (((previousValue != value) 
+							|| (this._ClientConfig.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._ClientConfig.Entity = null;
+						previousValue.Clients.Remove(this);
+					}
+					this._ClientConfig.Entity = value;
+					if ((value != null))
+					{
+						value.Clients.Add(this);
+						this._ClientConfigId = value.ClientConfigId;
+					}
+					else
+					{
+						this._ClientConfigId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("ClientConfig");
+				}
+			}
+		}
+		
+		private void attach_UptimeStatistics(UptimeStatistic entity)
+		{
+			this.SendPropertyChanging();
+			entity.Client = this;
+		}
+		
+		private void detach_UptimeStatistics(UptimeStatistic entity)
+		{
+			this.SendPropertyChanging();
+			entity.Client = null;
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Client = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Client = null;
+		}
+	}
+	
+	public partial class ClientGroup : Resource
+	{
+		
+		private EntitySet<ClientGroup_Resource> _ClientGroup_Resources_Children;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    #endregion
+		
+		public ClientGroup()
+		{
+			this._ClientGroup_Resources_Children = new EntitySet<ClientGroup_Resource>(new Action<ClientGroup_Resource>(this.attach_ClientGroup_Resources_Children), new Action<ClientGroup_Resource>(this.detach_ClientGroup_Resources_Children));
+			OnCreated();
+		}
+		
+		[Association(Name="ClientGroup_ClientGroup_Resource", Storage="_ClientGroup_Resources_Children", ThisKey="ResourceId", OtherKey="ClientGroupId")]
+		public EntitySet<ClientGroup_Resource> ClientGroup_Resources_Children
+		{
+			get
+			{
+				return this._ClientGroup_Resources_Children;
+			}
+			set
+			{
+				this._ClientGroup_Resources_Children.Assign(value);
+			}
+		}
+		
+		private void attach_ClientGroup_Resources_Children(ClientGroup_Resource entity)
+		{
+			this.SendPropertyChanging();
+			entity.ClientGroup = this;
+		}
+		
+		private void detach_ClientGroup_Resources_Children(ClientGroup_Resource entity)
+		{
+			this.SendPropertyChanging();
+			entity.ClientGroup = null;
+		}
+	}
+	
+	[Table(Name="dbo.Job")]
+	public partial class Job : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _JobId;
+		
+		private System.Nullable<System.Guid> _ParentJobId;
+		
+		private string _JobState;
+		
+		private System.Nullable<System.Guid> _ResourceId;
+		
+		private System.Nullable<double> _Percentage;
+		
+		private System.Data.Linq.Link<System.Data.Linq.Binary> _SerializedJob;
+		
+		private System.Nullable<System.DateTime> _DateCreated;
+		
+		private System.Nullable<System.DateTime> _DateCalculated;
+		
+		private System.Nullable<System.DateTime> _DateFinished;
+		
+		private int _Priority;
+		
+		private System.Nullable<System.Guid> _ProjectId;
+		
+		private System.Nullable<System.Guid> _UserId;
+		
+		private int _CoresNeeded;
+		
+		private int _MemoryNeeded;
+		
+		private EntitySet<AssignedResource> _AssignedResources;
+		
+		private EntitySet<RequiredPlugin> _RequiredPlugins;
+		
+		private EntitySet<Job> _Jobs;
+		
+		private EntityRef<Job> _Job1;
+		
+		private EntityRef<Project> _Project;
+		
+		private EntityRef<Client> _Client;
+		
+    #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 OnParentJobIdChanging(System.Nullable<System.Guid> value);
+    partial void OnParentJobIdChanged();
+    partial void OnJobStateChanging(string value);
+    partial void OnJobStateChanged();
+    partial void OnResourceIdChanging(System.Nullable<System.Guid> value);
+    partial void OnResourceIdChanged();
+    partial void OnPercentageChanging(System.Nullable<double> value);
+    partial void OnPercentageChanged();
+    partial void OnSerializedJobChanging(System.Data.Linq.Binary value);
+    partial void OnSerializedJobChanged();
+    partial void OnDateCreatedChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateCreatedChanged();
+    partial void OnDateCalculatedChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateCalculatedChanged();
+    partial void OnDateFinishedChanging(System.Nullable<System.DateTime> value);
+    partial void OnDateFinishedChanged();
+    partial void OnPriorityChanging(int value);
+    partial void OnPriorityChanged();
+    partial void OnProjectIdChanging(System.Nullable<System.Guid> value);
+    partial void OnProjectIdChanged();
+    partial void OnUserIdChanging(System.Nullable<System.Guid> value);
+    partial void OnUserIdChanged();
+    partial void OnCoresNeededChanging(int value);
+    partial void OnCoresNeededChanged();
+    partial void OnMemoryNeededChanging(int value);
+    partial void OnMemoryNeededChanged();
+    #endregion
+		
+		public Job()
+		{
+			this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
+			this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins));
+			this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs));
+			this._Job1 = default(EntityRef<Job>);
+			this._Project = default(EntityRef<Project>);
+			this._Client = default(EntityRef<Client>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_JobId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid JobId
+		{
+			get
+			{
+				return this._JobId;
+			}
+			set
+			{
+				if ((this._JobId != value))
+				{
+					this.OnJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._JobId = value;
+					this.SendPropertyChanged("JobId");
+					this.OnJobIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ParentJobId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ParentJobId
+		{
+			get
+			{
+				return this._ParentJobId;
+			}
+			set
+			{
+				if ((this._ParentJobId != value))
+				{
+					if (this._Job1.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnParentJobIdChanging(value);
+					this.SendPropertyChanging();
+					this._ParentJobId = value;
+					this.SendPropertyChanged("ParentJobId");
+					this.OnParentJobIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_JobState", DbType="VarChar(MAX)")]
+		public string JobState
+		{
+			get
+			{
+				return this._JobState;
+			}
+			set
+			{
+				if ((this._JobState != value))
+				{
+					this.OnJobStateChanging(value);
+					this.SendPropertyChanging();
+					this._JobState = value;
+					this.SendPropertyChanged("JobState");
+					this.OnJobStateChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ResourceId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Client.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Percentage", DbType="Float")]
+		public System.Nullable<double> Percentage
+		{
+			get
+			{
+				return this._Percentage;
+			}
+			set
+			{
+				if ((this._Percentage != value))
+				{
+					this.OnPercentageChanging(value);
+					this.SendPropertyChanging();
+					this._Percentage = value;
+					this.SendPropertyChanged("Percentage");
+					this.OnPercentageChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_SerializedJob", DbType="VarBinary(MAX)", 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();
+				}
+			}
+		}
+		
+		[Column(Storage="_DateCreated", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateCreated
+		{
+			get
+			{
+				return this._DateCreated;
+			}
+			set
+			{
+				if ((this._DateCreated != value))
+				{
+					this.OnDateCreatedChanging(value);
+					this.SendPropertyChanging();
+					this._DateCreated = value;
+					this.SendPropertyChanged("DateCreated");
+					this.OnDateCreatedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_DateCalculated", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateCalculated
+		{
+			get
+			{
+				return this._DateCalculated;
+			}
+			set
+			{
+				if ((this._DateCalculated != value))
+				{
+					this.OnDateCalculatedChanging(value);
+					this.SendPropertyChanging();
+					this._DateCalculated = value;
+					this.SendPropertyChanged("DateCalculated");
+					this.OnDateCalculatedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_DateFinished", DbType="DateTime")]
+		public System.Nullable<System.DateTime> DateFinished
+		{
+			get
+			{
+				return this._DateFinished;
+			}
+			set
+			{
+				if ((this._DateFinished != value))
+				{
+					this.OnDateFinishedChanging(value);
+					this.SendPropertyChanging();
+					this._DateFinished = value;
+					this.SendPropertyChanged("DateFinished");
+					this.OnDateFinishedChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Priority", DbType="Int NOT NULL")]
+		public int Priority
+		{
+			get
+			{
+				return this._Priority;
+			}
+			set
+			{
+				if ((this._Priority != value))
+				{
+					this.OnPriorityChanging(value);
+					this.SendPropertyChanging();
+					this._Priority = value;
+					this.SendPropertyChanged("Priority");
+					this.OnPriorityChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ProjectId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> ProjectId
+		{
+			get
+			{
+				return this._ProjectId;
+			}
+			set
+			{
+				if ((this._ProjectId != value))
+				{
+					if (this._Project.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnProjectIdChanging(value);
+					this.SendPropertyChanging();
+					this._ProjectId = value;
+					this.SendPropertyChanged("ProjectId");
+					this.OnProjectIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_UserId", DbType="UniqueIdentifier")]
+		public System.Nullable<System.Guid> UserId
+		{
+			get
+			{
+				return this._UserId;
+			}
+			set
+			{
+				if ((this._UserId != value))
+				{
+					this.OnUserIdChanging(value);
+					this.SendPropertyChanging();
+					this._UserId = value;
+					this.SendPropertyChanged("UserId");
+					this.OnUserIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_CoresNeeded", DbType="Int NOT NULL")]
+		public int CoresNeeded
+		{
+			get
+			{
+				return this._CoresNeeded;
+			}
+			set
+			{
+				if ((this._CoresNeeded != value))
+				{
+					this.OnCoresNeededChanging(value);
+					this.SendPropertyChanging();
+					this._CoresNeeded = value;
+					this.SendPropertyChanged("CoresNeeded");
+					this.OnCoresNeededChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_MemoryNeeded", DbType="Int NOT NULL")]
+		public int MemoryNeeded
+		{
+			get
+			{
+				return this._MemoryNeeded;
+			}
+			set
+			{
+				if ((this._MemoryNeeded != value))
+				{
+					this.OnMemoryNeededChanging(value);
+					this.SendPropertyChanging();
+					this._MemoryNeeded = value;
+					this.SendPropertyChanged("MemoryNeeded");
+					this.OnMemoryNeededChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Job_AssignedResource", Storage="_AssignedResources", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<AssignedResource> AssignedResources
+		{
+			get
+			{
+				return this._AssignedResources;
+			}
+			set
+			{
+				this._AssignedResources.Assign(value);
+			}
+		}
+		
+		[Association(Name="Job_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="JobId", OtherKey="JobId")]
+		public EntitySet<RequiredPlugin> RequiredPlugins
+		{
+			get
+			{
+				return this._RequiredPlugins;
+			}
+			set
+			{
+				this._RequiredPlugins.Assign(value);
+			}
+		}
+		
+		[Association(Name="Job_Job", Storage="_Jobs", ThisKey="JobId", OtherKey="ParentJobId")]
+		public EntitySet<Job> Jobs
+		{
+			get
+			{
+				return this._Jobs;
+			}
+			set
+			{
+				this._Jobs.Assign(value);
+			}
+		}
+		
+		[Association(Name="Job_Job", Storage="_Job1", ThisKey="ParentJobId", OtherKey="JobId", IsForeignKey=true)]
+		public Job Job1
+		{
+			get
+			{
+				return this._Job1.Entity;
+			}
+			set
+			{
+				Job previousValue = this._Job1.Entity;
+				if (((previousValue != value) 
+							|| (this._Job1.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Job1.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._Job1.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._ParentJobId = value.JobId;
+					}
+					else
+					{
+						this._ParentJobId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Job1");
+				}
+			}
+		}
+		
+		[Association(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="SET NULL")]
+		public Project Project
+		{
+			get
+			{
+				return this._Project.Entity;
+			}
+			set
+			{
+				Project previousValue = this._Project.Entity;
+				if (((previousValue != value) 
+							|| (this._Project.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Project.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._Project.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._ProjectId = value.ProjectId;
+					}
+					else
+					{
+						this._ProjectId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Project");
+				}
+			}
+		}
+		
+		[Association(Name="Client_Job", Storage="_Client", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="SET NULL")]
+		public Client Client
+		{
+			get
+			{
+				return this._Client.Entity;
+			}
+			set
+			{
+				Client previousValue = this._Client.Entity;
+				if (((previousValue != value) 
+							|| (this._Client.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Client.Entity = null;
+						previousValue.Jobs.Remove(this);
+					}
+					this._Client.Entity = value;
+					if ((value != null))
+					{
+						value.Jobs.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(Nullable<System.Guid>);
+					}
+					this.SendPropertyChanged("Client");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_AssignedResources(AssignedResource entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = this;
+		}
+		
+		private void detach_RequiredPlugins(RequiredPlugin entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job = null;
+		}
+		
+		private void attach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job1 = this;
+		}
+		
+		private void detach_Jobs(Job entity)
+		{
+			this.SendPropertyChanging();
+			entity.Job1 = null;
+		}
+	}
+	
+	[Table(Name="dbo.UptimeCalendar")]
+	public partial class UptimeCalendar : INotifyPropertyChanging, INotifyPropertyChanged
+	{
+		
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private System.Guid _UptimeCalendarId;
+		
+		private System.Guid _ResourceId;
+		
+		private System.DateTime _StartDate;
+		
+		private System.DateTime _EndDate;
+		
+		private bool _AllDayEvent;
+		
+		private bool _Recurring;
+		
+		private System.Guid _RecurringId;
+		
+		private EntityRef<Resource> _Resource;
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    partial void OnUptimeCalendarIdChanging(System.Guid value);
+    partial void OnUptimeCalendarIdChanged();
+    partial void OnResourceIdChanging(System.Guid value);
+    partial void OnResourceIdChanged();
+    partial void OnStartDateChanging(System.DateTime value);
+    partial void OnStartDateChanged();
+    partial void OnEndDateChanging(System.DateTime value);
+    partial void OnEndDateChanged();
+    partial void OnAllDayEventChanging(bool value);
+    partial void OnAllDayEventChanged();
+    partial void OnRecurringChanging(bool value);
+    partial void OnRecurringChanged();
+    partial void OnRecurringIdChanging(System.Guid value);
+    partial void OnRecurringIdChanged();
+    #endregion
+		
+		public UptimeCalendar()
+		{
+			this._Resource = default(EntityRef<Resource>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
+		public System.Guid UptimeCalendarId
+		{
+			get
+			{
+				return this._UptimeCalendarId;
+			}
+			set
+			{
+				if ((this._UptimeCalendarId != value))
+				{
+					this.OnUptimeCalendarIdChanging(value);
+					this.SendPropertyChanging();
+					this._UptimeCalendarId = value;
+					this.SendPropertyChanged("UptimeCalendarId");
+					this.OnUptimeCalendarIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL")]
+		public System.Guid ResourceId
+		{
+			get
+			{
+				return this._ResourceId;
+			}
+			set
+			{
+				if ((this._ResourceId != value))
+				{
+					if (this._Resource.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnResourceIdChanging(value);
+					this.SendPropertyChanging();
+					this._ResourceId = value;
+					this.SendPropertyChanged("ResourceId");
+					this.OnResourceIdChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_StartDate", DbType="DateTime NOT NULL")]
+		public System.DateTime StartDate
+		{
+			get
+			{
+				return this._StartDate;
+			}
+			set
+			{
+				if ((this._StartDate != value))
+				{
+					this.OnStartDateChanging(value);
+					this.SendPropertyChanging();
+					this._StartDate = value;
+					this.SendPropertyChanged("StartDate");
+					this.OnStartDateChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_EndDate", DbType="DateTime NOT NULL")]
+		public System.DateTime EndDate
+		{
+			get
+			{
+				return this._EndDate;
+			}
+			set
+			{
+				if ((this._EndDate != value))
+				{
+					this.OnEndDateChanging(value);
+					this.SendPropertyChanging();
+					this._EndDate = value;
+					this.SendPropertyChanged("EndDate");
+					this.OnEndDateChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_AllDayEvent", DbType="Bit NOT NULL")]
+		public bool AllDayEvent
+		{
+			get
+			{
+				return this._AllDayEvent;
+			}
+			set
+			{
+				if ((this._AllDayEvent != value))
+				{
+					this.OnAllDayEventChanging(value);
+					this.SendPropertyChanging();
+					this._AllDayEvent = value;
+					this.SendPropertyChanged("AllDayEvent");
+					this.OnAllDayEventChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_Recurring", DbType="Bit NOT NULL")]
+		public bool Recurring
+		{
+			get
+			{
+				return this._Recurring;
+			}
+			set
+			{
+				if ((this._Recurring != value))
+				{
+					this.OnRecurringChanging(value);
+					this.SendPropertyChanging();
+					this._Recurring = value;
+					this.SendPropertyChanged("Recurring");
+					this.OnRecurringChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_RecurringId", DbType="UniqueIdentifier")]
+		public System.Guid RecurringId
+		{
+			get
+			{
+				return this._RecurringId;
+			}
+			set
+			{
+				if ((this._RecurringId != value))
+				{
+					this.OnRecurringIdChanging(value);
+					this.SendPropertyChanging();
+					this._RecurringId = value;
+					this.SendPropertyChanged("RecurringId");
+					this.OnRecurringIdChanged();
+				}
+			}
+		}
+		
+		[Association(Name="Resource_UptimeCalendar", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		public Resource Resource
+		{
+			get
+			{
+				return this._Resource.Entity;
+			}
+			set
+			{
+				Resource previousValue = this._Resource.Entity;
+				if (((previousValue != value) 
+							|| (this._Resource.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._Resource.Entity = null;
+						previousValue.UptimeCalendars.Remove(this);
+					}
+					this._Resource.Entity = value;
+					if ((value != null))
+					{
+						value.UptimeCalendars.Add(this);
+						this._ResourceId = value.ResourceId;
+					}
+					else
+					{
+						this._ResourceId = default(System.Guid);
+					}
+					this.SendPropertyChanged("Resource");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+	}
+}
+#pragma warning restore 1591
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.xml
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.xml	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/HiveDataContext.xml	(revision 3931)
@@ -1,4 +1,4 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<Database Name="HeuristicLab.Hive.Linq" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
+<Database Name="HeuristicLab.Hive.Linq.Test" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
   <Table Name="dbo.AssignedResources" Member="AssignedResources">
     <Type Name="AssignedResource">
@@ -6,6 +6,6 @@
       <Column Name="JobId" Member="JobId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" />
       <Column Name="AssignedRessourcesId" Member="AssignedRessourcesId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" IsPrimaryKey="true" IsDbGenerated="true" AutoSync="OnInsert" />
-      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" DeleteRule="CASCADE" DeleteOnNull="true" IsForeignKey="true" Type="Resource"/>
-      <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" DeleteRule="CASCADE" DeleteOnNull="true" IsForeignKey="true" Type="Job"/>
+      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" DeleteRule="CASCADE" IsForeignKey="true" Type="Resource"/>
+      <Association Name="Job_AssignedResource" Member="Job" ThisKey="JobId" OtherKey="JobId" DeleteRule="CASCADE" IsForeignKey="true" Type="Job"/>
     </Type>
   </Table>
@@ -23,5 +23,5 @@
       <Column Name="ClientConfigId" Member="ClientConfigId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" IsPrimaryKey="true" IsDbGenerated="true" AutoSync="OnInsert" />
       <Column Name="UpDownTimeCalendar" Member="UpDownTimeCalendar" DbType="Xml" UpdateCheck="Never" Type="System.Xml.Linq.XElement"/>
-      <Column Name="HeartBeatIntervall" Member="HeartBeatIntervall" DbType="Int" Type="System.Int32"/>
+      <Column Name="HeartBeatIntervall" Member="HeartBeatIntervall" DbType="Int" Type="System.Int32" CanBeNull="true"/>
       <Association Name="ClientConfig_Client" Member="Clients"  ThisKey="ClientConfigId" OtherKey="ClientConfigId" Type="Client"/>
     </Type>
@@ -30,10 +30,10 @@
   <Table Name="dbo.ClientGroup_Resource" Member="ClientGroup_Resources">
     <Type Name="ClientGroup_Resource">
-      <Column Name="ClientGroup_RessourceId" Member="ClientGroup_RessourceId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" IsPrimaryKey="true" IsDbGenerated="true" AutoSync="OnInsert" />
+      <Column Name="ClientGroup_RessourceId" Member="ClientGroup_RessourceId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" IsPrimaryKey="true" IsDbGenerated="true" AutoSync="OnInsert"  />
       <Column Name="ClientGroupId" Member="ClientGroupId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" />
       <Column Name="ResourceId" Member="ResourceId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" />
     
       <Association Name="ClientGroup_ClientGroup_Resource" Member="ClientGroup" ThisKey="ClientGroupId" OtherKey="ResourceId" IsForeignKey="true" Type="ClientGroup" />
-      <Association Name="Resource_ClientGroup_Resource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" DeleteRule="CASCADE" DeleteOnNull="true" IsForeignKey="true" Type="Resource"/>
+      <Association Name="Resource_ClientGroup_Resource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" DeleteRule="CASCADE" IsForeignKey="true" Type="Resource"/>
     </Type>
   </Table>
@@ -59,5 +59,5 @@
       <Column Name="JobId" Member="JobId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" />
       <Column Name="PluginId" Member="PluginId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" />
-      <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" DeleteRule="CASCADE" DeleteOnNull="true" IsForeignKey="true" Type="PluginInfo"/>
+      <Association Name="PluginInfo_RequiredPlugin" Member="PluginInfo" ThisKey="PluginId" OtherKey="PluginId" DeleteRule="CASCADE" IsForeignKey="true" Type="PluginInfo"/>
       <Association Name="Job_RequiredPlugin" Member="Job" ThisKey="JobId" OtherKey="JobId" IsForeignKey="true" Type="Job"/>
     </Type>
@@ -69,23 +69,23 @@
       <Column Name="ResourceType" Member="ResourceType" IsDiscriminator="true" Type="System.String"/>
       <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource"/>      
-      <Association Name="Resource_ClientGroup_Resource" Member="ClientGroup_Resources" ThisKey="ResourceId" OtherKey="ResourceId" Type="ClientGroup_Resource" />
+      <Association Name="Resource_ClientGroup_Resource" Member="ClientGroup_Resources_Parents" ThisKey="ResourceId" OtherKey="ResourceId" Type="ClientGroup_Resource" />
       <Association Name="Resource_UptimeCalendar" Member="UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeCalendar" />      
       <Type Name="Client" InheritanceCode="CLIENT" IsInheritanceDefault="true">        
-        <Column Name="CPUSpeed" Member="CPUSpeed" DbType="Int NOT NULL" Type="System.Int32" />
-        <Column Name="Memory" Member="Memory" DbType="Int NOT NULL" Type="System.Int32" />
-        <Column Name="Login" Member="Login" DbType="DateTime NOT NULL" Type="System.DateTime" />
-        <Column Name="Status" Member="Status" DbType="VarChar(MAX)" Type="System.String" />
-        <Column Name="CalendarSyncStatus" Member="CalendarSyncStatus" DbType="VarChar(MAX)" Type="System.String" />
-        <Column Name="UseCalendarFromResourceId" Member="UseCalendarFromResourceId" DbType="UniqueIdentifier" Type="System.Guid"/>
-        <Column Name="ClientConfigId" Member="ClientConfigId" DbType="UniqueIdentifier" Type="System.Guid"/>
-        <Column Name="NumberOfCores" Member="NumberOfCores" DbType="Int NOT NULL" Type="System.Int32" />
-        <Column Name="NumberOfFreeCores" Member="NumberOfFreeCores" DbType="Int NOT NULL" Type="System.Int32"/>
-        <Column Name="FreeMemory" Member="FreeMemory" DbType="Int NOT NULL" Type="System.Int32"/>
+        <Column Name="CPUSpeed" Member="CPUSpeed" DbType="Int" Type="System.Int32" CanBeNull="true"/>
+        <Column Name="Memory" Member="Memory" DbType="Int" Type="System.Int32" CanBeNull="true"/>
+        <Column Name="Login" Member="Login" DbType="DateTime" Type="System.DateTime" CanBeNull="true"/>
+        <Column Name="Status" Member="Status" DbType="VarChar(MAX)" Type="System.String" CanBeNull="true"/>
+        <Column Name="CalendarSyncStatus" Member="CalendarSyncStatus" DbType="VarChar(MAX)" Type="System.String" CanBeNull="true"/>
+        <Column Name="UseCalendarFromResourceId" Member="UseCalendarFromResourceId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
+        <Column Name="ClientConfigId" Member="ClientConfigId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
+        <Column Name="NumberOfCores" Member="NumberOfCores" DbType="Int" Type="System.Int32" CanBeNull="true"/>
+        <Column Name="NumberOfFreeCores" Member="NumberOfFreeCores" DbType="Int" Type="System.Int32" CanBeNull="true"/>
+        <Column Name="FreeMemory" Member="FreeMemory" DbType="Int" Type="System.Int32" CanBeNull="true"/>
         <Association Name="Client_UptimeStatistic" Member="UptimeStatistics" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeStatistic"/>
-        <Association Name="Client_Job" Member="Jobs" ThisKey="ResourceId" OtherKey="ResourceId" Type="Job"/>        
+        <Association Name="Client_Job" Member="Jobs" ThisKey="ResourceId" OtherKey="ResourceId" Type="Job" DeleteRule="SET NULL"/>        
         <Association Name="ClientConfig_Client" Member="ClientConfig" ThisKey="ClientConfigId" OtherKey="ClientConfigId" DeleteRule="SET NULL" IsForeignKey="true" Type="ClientConfig"/>
       </Type>
       <Type Name="ClientGroup" InheritanceCode="GROUP" IsInheritanceDefault="false">
-        <Association Name="ClientGroup_ClientGroup_Resource" Member="ClientGroup_Resources" ThisKey="ResourceId" OtherKey="ClientGroupId" Type="ClientGroup_Resource" />
+        <Association Name="ClientGroup_ClientGroup_Resource" Member="ClientGroup_Resources_Children" ThisKey="ResourceId" OtherKey="ClientGroupId" Type="ClientGroup_Resource" />
       </Type>
     </Type>
@@ -95,15 +95,15 @@
     <Type Name="Job">
       <Column Name="JobId" Member="JobId" DbType="UniqueIdentifier NOT NULL" Type="System.Guid" IsPrimaryKey="true" IsDbGenerated="true" AutoSync="OnInsert" />
-      <Column Name="ParentJobId" Member="ParentJobId" DbType="UniqueIdentifier" Type="System.Guid" />
+      <Column Name="ParentJobId" Member="ParentJobId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true" />
       <Column Name="JobState" Member="JobState" DbType="VarChar(MAX)" Type="System.String"/>
-      <Column Name="ResourceId" Member="ResourceId" DbType="UniqueIdentifier" Type="System.Guid"/>
-      <Column Name="Percentage" Member="Percentage" DbType="Float" Type="System.Double"/>
-      <Column Name="SerializedJob" Member="SerializedJob" DbType="VarBinary(MAX)" UpdateCheck="Never" Type="System.Data.Linq.Binary"/>
-      <Column Name="DateCreated" Member="DateCreated" DbType="DateTime" Type="System.DateTime"/>
-      <Column Name="DateCalculated" Member="DateCalculated" DbType="DateTime" Type="System.DateTime"/>
-      <Column Name="DateFinished" Member="DateFinished" DbType="DateTime" Type="System.DateTime"/>
+      <Column Name="ResourceId" Member="ResourceId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
+      <Column Name="Percentage" Member="Percentage" DbType="Float" Type="System.Double" CanBeNull="true"/>
+      <Column Name="SerializedJob" Member="SerializedJob" DbType="VarBinary(MAX)" UpdateCheck="Never" Type="System.Data.Linq.Binary" IsDelayLoaded="true"/>
+      <Column Name="DateCreated" Member="DateCreated" DbType="DateTime" Type="System.DateTime" CanBeNull="true"/>
+      <Column Name="DateCalculated" Member="DateCalculated" DbType="DateTime" Type="System.DateTime" CanBeNull="true"/>
+      <Column Name="DateFinished" Member="DateFinished" DbType="DateTime" Type="System.DateTime" CanBeNull="true"/>
       <Column Name="Priority" Member="Priority" DbType="Int NOT NULL" Type="System.Int32"/>
-      <Column Name="ProjectId" Member="ProjectId" DbType="UniqueIdentifier" Type="System.Guid"/>
-      <Column Name="UserId" Member="UserId" DbType="UniqueIdentifier" Type="System.Guid"/>
+      <Column Name="ProjectId" Member="ProjectId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
+      <Column Name="UserId" Member="UserId" DbType="UniqueIdentifier" Type="System.Guid" CanBeNull="true"/>
       <Column Name="CoresNeeded" Member="CoresNeeded" DbType="Int NOT NULL" Type="System.Int32"/>
       <Column Name="MemoryNeeded" Member="MemoryNeeded" DbType="Int NOT NULL" Type="System.Int32"/>
@@ -125,5 +125,5 @@
       <Column Name="Recurring" Member="Recurring" DbType="Bit NOT NULL" Type="System.Boolean"/>
       <Column Name="RecurringId" Member="RecurringId" DbType="UniqueIdentifier" Type="System.Guid"/>
-      <Association Name="Resource_UptimeCalendar" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" DeleteRule="CASCADE" DeleteOnNull="true" IsForeignKey="true" Type="Resource"/>
+      <Association Name="Resource_UptimeCalendar" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" DeleteRule="CASCADE" IsForeignKey="true" Type="Resource"/>
     </Type>
   </Table>
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/JobDao.cs	(revision 3931)
@@ -63,4 +63,12 @@
     }
 
+    public void SetBinaryJobFile(Guid jobId, byte[] data) {
+      Job j = (from job in Context.Jobs
+               where job.JobId.Equals(jobId)
+               select job).SingleOrDefault();
+      j.SerializedJob = data;
+      CommitChanges();
+    }
+
     public SerializedJob InsertWithAttachedJob(SerializedJob job) {
       Job j = DtoToEntity(job.JobInfo, null);
@@ -121,5 +129,5 @@
 
     public void AssignClientToJob(Guid clientId, Guid jobId) {
-      Client c = Context.Clients.SingleOrDefault(client => client.ResourceId.Equals(clientId));
+      Client c = Context.Resources.OfType<Client>().SingleOrDefault(client => client.ResourceId.Equals(clientId));
       Job j = Context.Jobs.SingleOrDefault(job => job.JobId.Equals(jobId));
       c.Jobs.Add(j);
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Properties/Settings.Designer.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Properties/Settings.Designer.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Properties/Settings.Designer.cs	(revision 3931)
@@ -28,5 +28,5 @@
         [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
         [global::System.Configuration.DefaultSettingValueAttribute("Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=" +
-            "True")]
+            "True;MultipleActiveResultSets=True")]
         public string HeuristicLab_Hive_LinqConnectionString {
             get {
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Properties/Settings.settings
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Properties/Settings.settings	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/Properties/Settings.settings	(revision 3931)
@@ -6,8 +6,8 @@
       <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
 &lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;ConnectionString&gt;Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True&lt;/ConnectionString&gt;
+  &lt;ConnectionString&gt;Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True;MultipleActiveResultSets=True&lt;/ConnectionString&gt;
   &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
 &lt;/SerializableConnectionString&gt;</DesignTimeValue>
-      <Value Profile="(Default)">Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True</Value>
+      <Value Profile="(Default)">Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True;MultipleActiveResultSets=True</Value>
     </Setting>
   </Settings>
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/UptimeCalendarDao.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/UptimeCalendarDao.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/UptimeCalendarDao.cs	(revision 3931)
@@ -99,20 +99,20 @@
 
     public IEnumerable<AppointmentDto> GetCalendarForClient(ClientDto client) {
-      Client dbc = Context.Clients.SingleOrDefault(c => c.ResourceId.Equals(client.Id));
+      Client dbc = Context.Resources.OfType<Client>().SingleOrDefault(c => c.ResourceId.Equals(client.Id));
       IList<AppointmentDto> appointments = new List<AppointmentDto>();
       if (dbc != null) {
         ClientGroup cg =
-          Context.ClientGroups.SingleOrDefault(cgroup => cgroup.ResourceId.Equals(dbc.UseCalendarFromResourceId));
+          Context.Resources.OfType<ClientGroup>().SingleOrDefault(cgroup => cgroup.ResourceId.Equals(dbc.UseCalendarFromResourceId));
         //in case no plan has been set
         if (cg == null)
-          if (dbc.Resource.ClientGroup_Resources.FirstOrDefault() != null)
-            cg = dbc.Resource.ClientGroup_Resources.FirstOrDefault().ClientGroup;
+          if (dbc.ClientGroup_Resources_Parents.FirstOrDefault() != null)
+            cg = dbc.ClientGroup_Resources_Parents.FirstOrDefault().ClientGroup;
 
         if (cg == null)
           return appointments;
 
-        while (cg.Resource.UptimeCalendars.Count == 0) {
-          if (cg.Resource.ClientGroup_Resources.FirstOrDefault() != null)
-            cg = cg.Resource.ClientGroup_Resources.FirstOrDefault().ClientGroup;
+        while (cg.UptimeCalendars.Count == 0) {
+          if (cg.ClientGroup_Resources_Parents.FirstOrDefault() != null)
+            cg = cg.ClientGroup_Resources_Parents.FirstOrDefault().ClientGroup;
           else {
             break;
@@ -120,5 +120,5 @@
         }
 
-        foreach (UptimeCalendar appointment in cg.Resource.UptimeCalendars) {
+        foreach (UptimeCalendar appointment in cg.UptimeCalendars) {
           appointments.Add(EntityToDto(appointment,null));  
         }
@@ -131,10 +131,10 @@
       
       //Get the current ClientGroup
-      ClientGroup cg = Context.ClientGroups.SingleOrDefault(cgroup => cgroup.ResourceId.Equals(groupId));
+      ClientGroup cg = Context.Resources.OfType<ClientGroup>().SingleOrDefault(cgroup => cgroup.ResourceId.Equals(groupId));
       if(cg == null)
         return;
 
       //Get all the affected clients
-      List<Client> clients = Context.Clients.Where(c => c.UseCalendarFromResourceId.Equals(cg.ResourceId)).ToList();
+      List<Client> clients = Context.Resources.OfType<Client>().Where(c => c.UseCalendarFromResourceId.Equals(cg.ResourceId)).ToList();
       
       //Set new state
@@ -146,6 +146,6 @@
 
       //Get all Subgroups
-      List<ClientGroup> groups = (from cg1 in Context.ClientGroups
-                                  where cg1.Resource.ClientGroup_Resources.Any(
+      List<ClientGroup> groups = (from cg1 in Context.Resources.OfType<ClientGroup>()
+                                  where cg1.ClientGroup_Resources_Parents.Any(
                                 cgr => cgr.ClientGroupId.Equals(groupId))
                               select cg1).ToList();
@@ -154,6 +154,6 @@
       //otherweise - propagate
       foreach (ClientGroup cgroup in groups) {
-        if(cgroup.Resource.UptimeCalendars.Count == 0)
-          NotifyClientsOfNewCalendar(groupId, forcePush);        
+        if(cgroup.UptimeCalendars.Count == 0)
+          NotifyClientsOfNewCalendar(cgroup.ResourceId, forcePush);        
       }
     }
Index: /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/app.config
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/app.config	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/app.config	(revision 3931)
@@ -5,5 +5,5 @@
     <connectionStrings>
         <add name="HeuristicLab.Hive.Server.LINQDataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString"
-            connectionString="Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True"
+            connectionString="Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True;MultipleActiveResultSets=True"
             providerName="System.Data.SqlClient" />
     </connectionStrings>
Index: /branches/3.2/sources/HeuristicLab.Hive.Server/3.2/ServiceCallInterception.cs
===================================================================
--- /branches/3.2/sources/HeuristicLab.Hive.Server/3.2/ServiceCallInterception.cs	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Hive.Server/3.2/ServiceCallInterception.cs	(revision 3931)
@@ -16,7 +16,8 @@
 
     public object Invoke(IMethodInvocation invocation) {
+      DateTime start = DateTime.Now;
       Logger.Info("Entering Method: " + invocation.Method.Name);
 
-      if(ContextFactory.Context != null) {
+      if(!ContextFactory.IsContextNull()) {
         Logger.Info("Not null context found - why wasn't this disposed?");
         try {
@@ -28,8 +29,9 @@
         ContextFactory.Context = null;
       }
-
+      Logger.Info("Context info: Timeout: " + ContextFactory.Context.Connection.ConnectionTimeout + " | " +
+                  ContextFactory.Context.Connection.State + " | Conn: " + ContextFactory.Context + " | HashCode is: " + ContextFactory.Context.Connection.GetHashCode());
       Object obj = null;
 
-      if (invocation.Method.Name.Equals("SendStreamedJob") || invocation.Method.Name.Equals("StoreFinishedJobResultStreamed")) {        
+      /*if (invocation.Method.Name.Equals("SendStreamedJob") || invocation.Method.Name.Equals("StoreFinishedJobResultStreamed")) {        
         ContextFactory.Context.Connection.Open();
         if(UseTransactions) {
@@ -48,5 +50,5 @@
           ContextFactory.Context = null;
         }        
-      } else {
+      } else { */
         if(UseTransactions) {
           using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
@@ -57,5 +59,6 @@
             }
             catch (Exception e) {
-              Logger.Error("Exception occured during method invocation", e);              
+              Logger.Error("Exception occured during method invocation", e);     
+              Logger.Error("Inner Exception: ", e.InnerException);
             }
             finally {
@@ -80,7 +83,15 @@
           }  
         }
+      //}       
+      TimeSpan ts = DateTime.Now - start;
+      if (ts.Seconds > 2) {
+        Logger.Warn("Invocation took: " + ts);
+      } else if (ts.Seconds > 10) {
+        Logger.Error("Invocation took: " + ts);
+      } else {
+        Logger.Info("Invocation took: " + ts); ;
       }
       Logger.Info("Leaving Method: " + invocation.Method.Name);
-
+      
       return obj;
     }
Index: /branches/3.2/sources/HeuristicLab.Tracing/3.2/HeuristicLab.Hive.log4net.xml
===================================================================
--- /branches/3.2/sources/HeuristicLab.Tracing/3.2/HeuristicLab.Hive.log4net.xml	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Tracing/3.2/HeuristicLab.Hive.log4net.xml	(revision 3931)
@@ -6,9 +6,9 @@
     <rollingStyle value="Size" />
     <maxSizeRollBackups value="10" />
-    <maximumFileSize value="1000KB" />
+    <maximumFileSize value="100MB" />
     <staticLogFileName value="true" />
     <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
     <layout type="HeuristicLab.Tracing.MethodCallPatternLayout, HeuristicLab.Tracing-3.2">
-      <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.ffff} %-4timestamp %-5level %logger.%RM - %message%newline%exception" />
+      <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.ffff} %-4timestamp %-5level %-5thread %logger.%RM - %message%newline%exception" />
     </layout>
   </appender>
@@ -19,9 +19,9 @@
     <rollingStyle value="Size" />
     <maxSizeRollBackups value="10" />
-    <maximumFileSize value="1000KB" />
+    <maximumFileSize value="100MB" />
     <staticLogFileName value="true" />
     <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
     <layout type="HeuristicLab.Tracing.MethodCallPatternLayout, HeuristicLab.Tracing-3.2">
-      <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.ffff} %-4timestamp %-5level %logger.%RM - %message%newline%exception" />
+      <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.ffff} %-4timestamp %-5level %-5thread %logger.%RM - %message%newline%exception" />
     </layout>
   </appender>
@@ -32,9 +32,9 @@
     <rollingStyle value="Size" />
     <maxSizeRollBackups value="10" />
-    <maximumFileSize value="1000KB" />
+    <maximumFileSize value="100MB" />
     <staticLogFileName value="true" />
     <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
     <layout type="HeuristicLab.Tracing.MethodCallPatternLayout, HeuristicLab.Tracing-3.2">
-      <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.ffff} %-4timestamp %-5level %logger.%RM - %message%newline%exception" />
+      <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.ffff} %-4timestamp %-5level %-5thread %logger.%RM - %message%newline%exception" />
     </layout>
   </appender>
@@ -48,7 +48,34 @@
     <appender-ref ref="RollingFileAppender" />
   </appender>
+
+  <appender name="ClientBufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" >
+    <bufferSize value="128" />
+    <lossy value="true" />
+    <evaluator type="log4net.Core.LevelEvaluator">
+      <threshold value="DEBUG"/>
+    </evaluator>
+    <appender-ref ref="ClientRollingFileAppender" />
+  </appender>
+
+  <appender name="ServerBufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" >
+    <bufferSize value="128" />
+    <lossy value="true" />
+    <evaluator type="log4net.Core.LevelEvaluator">
+      <threshold value="DEBUG"/>
+    </evaluator>
+    <appender-ref ref="ServertRollingFileAppender" />
+  </appender>
+  
+  <appender name="BufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" >
+    <bufferSize value="128" />
+    <lossy value="true" />
+    <evaluator type="log4net.Core.LevelEvaluator">
+      <threshold value="DEBUG"/>
+    </evaluator>
+    <appender-ref ref="RollingFileAppender" />
+  </appender>
   
   <root>
-    <level value="INFO" />
+    <level value="DEBUG" />
     <appender-ref ref="BufferingForwardingAppender" />
   </root>
@@ -56,10 +83,10 @@
   <logger name="HeuristicLab.Hive.Server">
     <level value="DEBUG" />
-    <appender-ref ref="ServerRollingFileAppender" />    
+    <appender-ref ref="ServerBufferingForwardingAppender" />    
   </logger>
 
   <logger name="HeuristicLab.Hive.Client">
     <level value="DEBUG" />
-    <appender-ref ref="ClientRollingFileAppender" />  
+    <appender-ref ref="ClientBufferingForwardingAppender" />  
   </logger>
   
Index: /branches/3.2/sources/HeuristicLab.Tracing/3.2/app.config
===================================================================
--- /branches/3.2/sources/HeuristicLab.Tracing/3.2/app.config	(revision 3930)
+++ /branches/3.2/sources/HeuristicLab.Tracing/3.2/app.config	(revision 3931)
@@ -9,5 +9,5 @@
     <HeuristicLab.Tracing.Properties.Settings>
       <setting name="TracingLog4netConfigFile" serializeAs="String">
-        <value />
+        <value>HeuristicLab.Hive.log4net.xml</value>
       </setting>
     </HeuristicLab.Tracing.Properties.Settings>
