Index: branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HeuristicLabHiveExperimentPlugin.cs
===================================================================
--- branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HeuristicLabHiveExperimentPlugin.cs	(revision 4120)
+++ branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HeuristicLabHiveExperimentPlugin.cs	(revision 4121)
@@ -31,11 +31,16 @@
   [Plugin("HeuristicLab.Hive.Experiment", "3.3")]
   [PluginFile("HeuristicLab.Hive.Experiment-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
   [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
   [PluginDependency("HeuristicLab.Core", "3.3")]
   [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.DataAccess", "3.3")]
+  [PluginDependency("HeuristicLab.Hive.Contracts", "3.3")]
+  [PluginDependency("HeuristicLab.Hive.JobBase", "3.3")]
   [PluginDependency("HeuristicLab.Optimization", "3.3")]
   [PluginDependency("HeuristicLab.Persistence", "3.3")]
-  [PluginDependency("HeuristicLab.Hive.Contracts", "3.3")]
-  [PluginDependency("HeuristicLab.Hive.JobBase", "3.3")]
+  [PluginDependency("HeuristicLab.Tracing", "3.3")]
   public class HeuristicLabHiveExperimentPlugin : PluginBase {
 
Index: branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs
===================================================================
--- branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs	(revision 4120)
+++ branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs	(revision 4121)
@@ -52,5 +52,5 @@
     private const string itemName = "Hive Experiment";
     private const string itemDescription = "An experiment which contains multiple batch runs of algorithms which are executed in the Hive.";
-    private const int resultPollingIntervalMs = 10000;
+    private const int resultPollingIntervalMs = 15000;
 
     private object locker = new object();
@@ -128,5 +128,5 @@
 
     public override IDeepCloneable Clone(Cloner cloner) {
-      log.LogMessage("I am beeing cloned");
+      LogMessage("I am beeing cloned");
       HiveExperiment clone = (HiveExperiment)base.Clone(cloner);
       clone.resourceIds = this.resourceIds;
@@ -148,5 +148,5 @@
     private void AfterDeserialization() {
       InitTimer();
-      log.LogMessage("I was deserialized.");
+      LogMessage("I was deserialized.");
     }
 
@@ -224,5 +224,4 @@
           ResponseObject<JobDto> response = executionEngineFacade.AddJobWithGroupStrings(serializedJob, groups);
           pendingOptimizers.Add(response.Obj.Id, optimizer);
-          StartResultPollingThread(response.Obj);
 
           JobItem jobItem = new JobItem() {
@@ -236,5 +235,10 @@
           jobItems.Add(jobItem);
 
-          log.LogMessage("Sent job to server (jobId: " + response.Obj.Id + ")");
+          LogMessage("Sent job to server (jobId: " + response.Obj.Id + ")");
+        }
+
+        // start results polling after sending sending the jobs to the server (to avoid race conflicts at the optimizers-collection)
+        foreach (JobItem jobItem in jobItems) {
+          StartResultPollingThread(jobItem.JobDto);
         }
       });
@@ -256,6 +260,8 @@
 
     private void ReplaceOptimizer(IOptimizer originalOptimizer, IOptimizer newOptimizer) {
-      int originalOptimizerIndex = experiment.Optimizers.IndexOf(originalOptimizer);
-      experiment.Optimizers[originalOptimizerIndex] = newOptimizer;
+      lock (locker) {
+        int originalOptimizerIndex = experiment.Optimizers.IndexOf(originalOptimizer);
+        experiment.Optimizers[originalOptimizerIndex] = newOptimizer;
+      }
     }
 
@@ -308,10 +314,13 @@
         do {
           Thread.Sleep(resultPollingIntervalMs);
-          lock (locker) {
+          //lock (locker) { [chn] try without locking for better performance
             if (stopPending) return;
-            
-            ResponseObject<SerializedJob> response = executionEngineFacade.GetLastSerializedResult(job.Id, false, false);
-            log.LogMessage("Received response for job: " + response.StatusMessage + " (jobId: " + job.Id + ")");
-            
+
+            ResponseObject<JobDto> response = executionEngineFacade.GetJobById(job.Id);
+            LogMessage("Response: " + response.StatusMessage + " (jobId: " + job.Id + ")");
+
+            if (response.Obj != null) {
+              UpdateJobItem(response.Obj);
+            }
             
             // loop while 
@@ -320,11 +329,13 @@
             // 3. no result for the job is available yet (response.Obj==null)
             // 4. the result that we get from the server is a snapshot and not the final result
-            if (response.Success && response.Obj != null && response.StatusMessage != ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) {
-              restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(response.Obj.SerializedJobData));
+            if (response.Success && response.Obj != null && response.Obj.State == State.Finished) {
+              ResponseObject<SerializedJob> jobResponse = executionEngineFacade.GetLastSerializedResult(job.Id, false, false);
+              restoredObject = XmlParser.Deserialize<IJob>(new MemoryStream(jobResponse.Obj.SerializedJobData));
+              UpdateSnapshot(jobResponse);
             }
-          }
+          //}
         } while (restoredObject == null || restoredObject.ExecutionState != Core.ExecutionState.Stopped);
 
-        log.LogMessage("Job finished (jobId: " + job.Id + ")");
+        LogMessage("Job finished (jobId: " + job.Id + ")");
         // job retrieved... replace the existing optimizers with the finished one
         IOptimizer originalOptimizer = pendingOptimizers[job.Id];
@@ -340,7 +351,22 @@
         }
       });
-
-      Logger.Debug("HiveEngine: Starting results-polling thread");
       t.Start();
+    }
+
+    private void UpdateJobItem(JobDto jobDto) {
+      JobItem jobItem = jobItems.Single(x => x.JobDto.Id == jobDto.Id);
+      jobItem.JobDto = jobDto;
+    }
+
+    private void UpdateSnapshot(ResponseObject<SerializedJob> response) {
+      JobItem jobItem = jobItems.Single(x => x.JobDto.Id == response.Obj.JobInfo.Id);
+      jobItem.LatestSnapshot = response;
+    }
+
+    private void LogMessage(string message) {
+      // HeuristicLab.Log is not Thread-Safe, so lock every call
+      lock (locker) {
+        log.LogMessage(message);
+      }
     }
     
@@ -440,5 +466,5 @@
     public event EventHandler ExecutionStateChanged;
     private void OnExecutionStateChanged() {
-      log.LogMessage("ExecutionState changed to " + executionState.ToString());
+      LogMessage("ExecutionState changed to " + executionState.ToString());
       EventHandler handler = ExecutionStateChanged;
       if (handler != null) handler(this, EventArgs.Empty);
@@ -449,5 +475,5 @@
     public event EventHandler Started;
     private void OnStarted() {
-      log.LogMessage("Started");
+      LogMessage("Started");
       timer.Start();
       EventHandler handler = Started;
@@ -458,5 +484,5 @@
     private void OnStopped() {
       timer.Stop();
-      log.LogMessage("Stopped");
+      LogMessage("Stopped");
       EventHandler handler = Stopped;
       if (handler != null) handler(this, EventArgs.Empty);
@@ -466,5 +492,5 @@
     private void OnPaused() {
       timer.Stop();
-      log.LogMessage("Paused");
+      LogMessage("Paused");
       EventHandler handler = Paused;
       if (handler != null) handler(this, EventArgs.Empty);
@@ -473,5 +499,5 @@
     public event EventHandler Prepared;
     protected virtual void OnPrepared() {
-      log.LogMessage("Prepared");
+      LogMessage("Prepared");
       EventHandler handler = Prepared;
       if (handler != null) handler(this, EventArgs.Empty);
@@ -486,5 +512,5 @@
     public event EventHandler ExperimentChanged;
     protected virtual void OnExperimentChanged() {
-      log.LogMessage("Experiment changed");
+      LogMessage("Experiment changed");
       EventHandler handler = ExperimentChanged;
       if (handler != null) handler(this, EventArgs.Empty);
Index: branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/JobItem.cs
===================================================================
--- branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/JobItem.cs	(revision 4120)
+++ branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/JobItem.cs	(revision 4121)
@@ -7,7 +7,18 @@
 using HeuristicLab.Hive.Contracts.BusinessObjects;
 using HeuristicLab.Hive.Contracts;
+using System.Drawing;
 
 namespace HeuristicLab.Hive.Experiment {
   public class JobItem : Item {
+    public override Image ItemImage {
+      get {
+        if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
+        else if (jobDto.State == State.Idle) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
+        else if (jobDto.State == State.Calculating) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStarted;
+        else if (jobDto.State == State.Offline) return HeuristicLab.Common.Resources.VS2008ImageLibrary.ExecutableStopped;
+        else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
+      }
+    }
+
     [Storable]
     private JobDto jobDto;
@@ -17,5 +28,7 @@
         if (jobDto != value) {
           jobDto = value;
+          OnJobDtoChanged();
           OnToStringChanged();
+          OnItemImageChanged();
         }
       }
@@ -41,5 +54,12 @@
     }
 
+    [Storable]
+    private ILog log;
+    public ILog Log {
+      get { return log; }
+    }
+
     public JobItem() {
+      log = new Log();
     }
 
@@ -57,4 +77,10 @@
       if (handler != null) handler(this, EventArgs.Empty);
     }
+
+    public event EventHandler JobDtoChanged;
+    private void OnJobDtoChanged() {
+      EventHandler handler = JobDtoChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
   }
 }
Index: branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/Properties/AssemblyInfo.cs
===================================================================
--- branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/Properties/AssemblyInfo.cs	(revision 4120)
+++ branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/Properties/AssemblyInfo.cs	(revision 4121)
@@ -55,5 +55,5 @@
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("3.3.0.4119")]
-[assembly: AssemblyFileVersion("3.3.0.4119")]
-[assembly: AssemblyBuildDate("2010/07/29 16:49:01")]
+[assembly: AssemblyVersion("3.3.0.4120")]
+[assembly: AssemblyFileVersion("3.3.0.4120")]
+[assembly: AssemblyBuildDate("2010/07/30 13:39:10")]
