Index: /trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs	(revision 1140)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs	(revision 1141)
@@ -33,4 +33,5 @@
 using HeuristicLab.Hive.JobBase;
 using System.Runtime.CompilerServices;
+using HeuristicLab.Hive.Server.Core.InternalInterfaces;
 
 namespace HeuristicLab.Hive.Server.Core {
@@ -46,4 +47,5 @@
     IJobResultsAdapter jobResultAdapter;
     ILifecycleManager lifecycleManager;
+    IInternalJobManager jobManager;
 
     /// <summary>
@@ -57,4 +59,6 @@
       jobResultAdapter = ServiceLocator.GetJobResultsAdapter();
       lifecycleManager = ServiceLocator.GetLifecycleManager();
+      jobManager = ServiceLocator.GetJobManager() as 
+        IInternalJobManager;
 
       lifecycleManager.RegisterHeartbeat( 
@@ -90,5 +94,5 @@
                 foreach (Job job in allJobs) {
                   if (job.Client.ClientId == client.ClientId) {
-                    resetJobsDependingOnResults(job);
+                    jobManager.ResetJobsDependingOnResults(job);
                   }
                 }
@@ -108,29 +112,4 @@
     }
 
-    private void resetJobsDependingOnResults(Job job) {
-      List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.GetAll());
-      JobResult lastJobResult = null;
-      foreach (JobResult jR in allJobResults) {
-        if (jR.Job != null && jR.Job.Id == job.Id) {
-          if (lastJobResult != null) {
-            // if lastJobResult was before the current jobResult the lastJobResult must be updated
-            if ((jR.timestamp.Subtract(lastJobResult.timestamp)).Seconds > 0)
-              lastJobResult = jR;
-          }
-        }
-      }
-      if (lastJobResult != null) {
-        job.Client = null;
-        job.Percentage = lastJobResult.Percentage;
-        job.State = State.idle;
-        job.SerializedJob = lastJobResult.Result;
-      } else {
-        job.Client = null;
-        job.Percentage = 0;
-        job.State = State.idle;
-      }
-      jobAdapter.Update(job);
-    }
-
     #region IClientCommunicator Members
 
@@ -338,5 +317,5 @@
         foreach (Job job in allJobs) {
           if (job.Client.ClientId == client.ClientId) {
-            resetJobsDependingOnResults(job);
+            jobManager.ResetJobsDependingOnResults(job);
           }
         }
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj	(revision 1140)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj	(revision 1141)
@@ -82,4 +82,5 @@
     <Compile Include="InternalInterfaces\DataAccess\IUserAdapter.cs" />
     <Compile Include="InternalInterfaces\DataAccess\IUserGroupAdapter.cs" />
+    <Compile Include="InternalInterfaces\IInternalJobManager.cs" />
     <Compile Include="JobManager.cs" />
     <Compile Include="LifecycleManager.cs" />
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/IInternalJobManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/IInternalJobManager.cs	(revision 1141)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/IInternalJobManager.cs	(revision 1141)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Hive.Contracts.BusinessObjects;
+
+namespace HeuristicLab.Hive.Server.Core.InternalInterfaces {
+  interface IInternalJobManager {
+    void ResetJobsDependingOnResults(Job job);
+  }
+}
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs	(revision 1140)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs	(revision 1141)
@@ -28,7 +28,8 @@
 using HeuristicLab.Hive.Contracts;
 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
+using HeuristicLab.Hive.Server.Core.InternalInterfaces;
 
 namespace HeuristicLab.Hive.Server.Core {
-  class JobManager: IJobManager {
+  class JobManager: IJobManager, IInternalJobManager {
 
     IJobAdapter jobAdapter;
@@ -48,5 +49,5 @@
     }
 
-    private void resetJobsDependingOnResults(Job job) {
+    public void ResetJobsDependingOnResults(Job job) {
       List<JobResult> allJobResults = new List<JobResult>(jobResultAdapter.GetAll());
       JobResult lastJobResult = null;
@@ -77,5 +78,5 @@
       foreach (Job curJob in allJobs) {
         if (curJob.State == State.calculating) {
-          resetJobsDependingOnResults(curJob);
+          ResetJobsDependingOnResults(curJob);
         }
       }
