Index: trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs	(revision 2071)
+++ trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs	(revision 2073)
@@ -74,4 +74,5 @@
               procEngine.OperatorGraph.AddOperator(algorithm.Engine.OperatorGraph.InitialOperator);
               procEngine.OperatorGraph.InitialOperator = algorithm.Engine.OperatorGraph.InitialOperator;
+              procEngine.Reset();
               AsyncGridResult asyncResult = jobManager.BeginExecuteEngine(procEngine);
               asyncResults.Add(asyncResult.WaitHandle, asyncResult);
@@ -100,10 +101,10 @@
             }
             catch (Exception badEx) {
-              Trace.WriteLine("CEDMA Executer: Exception in job execution thread. " + badEx.Message);
+              HeuristicLab.Tracing.Logger.Error("CEDMA Executer: Exception in job execution thread. " + badEx.Message);
             }
           }
         }
         catch (Exception ex) {
-          Trace.WriteLine("CEDMA Executer: Exception in job-management thread. " + ex.Message);
+          HeuristicLab.Tracing.Logger.Warn("CEDMA Executer: Exception in job-management thread. " + ex.Message);
         }
       }
Index: trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HeuristicLab.Grid.HiveBridge-3.2.csproj
===================================================================
--- trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HeuristicLab.Grid.HiveBridge-3.2.csproj	(revision 2071)
+++ trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HeuristicLab.Grid.HiveBridge-3.2.csproj	(revision 2073)
@@ -101,4 +101,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>
   <ItemGroup>
Index: trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HeuristicLabGridHiveBridgePlugin.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HeuristicLabGridHiveBridgePlugin.cs	(revision 2071)
+++ trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HeuristicLabGridHiveBridgePlugin.cs	(revision 2073)
@@ -33,4 +33,5 @@
   [Dependency(Dependency = "HeuristicLab.Hive.JobBase-3.2")]
   [Dependency(Dependency = "HeuristicLab.Hive.Engine-3.2")]
+  [Dependency(Dependency = "HeuristicLab.Tracing-3.2")]
   public class HeuristicLabGridPlugin : PluginBase {
   }
Index: trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HiveGridServerWrapper.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HiveGridServerWrapper.cs	(revision 2071)
+++ trunk/sources/HeuristicLab.Grid.HiveBridge/3.2/HiveGridServerWrapper.cs	(revision 2073)
@@ -32,8 +32,14 @@
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
+using System.ServiceModel;
+using HeuristicLab.Tracing;
 
 namespace HeuristicLab.Grid.HiveBridge {
   public class HiveGridServerWrapper : IGridServer {
+    private const int MAX_CONNECTION_RETRIES = 10;
+    private const int RETRY_TIMEOUT_SEC = 60;
     private string address;
+    private IExecutionEngineFacade executionEngine;
+    private object connectionLock = new object();
 
     public HiveGridServerWrapper(string address) {
@@ -42,12 +48,11 @@
 
     public JobState JobState(Guid guid) {
-      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(address);
-      ResponseObject<JobResult> response = executionEngineFacade.GetLastResult(guid, false);
-      if (response.Success == true &&
+      ResponseObject<JobResult> response = SavelyExecute(() => executionEngine.GetLastResult(guid, false));
+      if (response != null && response.Success == true &&
         (response.StatusMessage == ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE ||
           response.StatusMessage == ApplicationConstants.RESPONSE_JOB_REQUEST_SET ||
           response.StatusMessage == ApplicationConstants.RESPONSE_JOB_REQUEST_ALLREADY_SET ||
           response.StatusMessage == ApplicationConstants.RESPONSE_JOB_JOB_RESULT_SENT)) {
-          return HeuristicLab.Grid.JobState.Busy;
+        return HeuristicLab.Grid.JobState.Busy;
       } else return HeuristicLab.Grid.JobState.Unknown;
     }
@@ -56,13 +61,12 @@
       var jobObj = CreateJobObj(engine);
 
-      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(address);
-      ResponseObject<HeuristicLab.Hive.Contracts.BusinessObjects.Job> res = executionEngineFacade.AddJob(jobObj);
-      return res.Obj.Id;
+      ResponseObject<HeuristicLab.Hive.Contracts.BusinessObjects.Job> res = SavelyExecute(() => executionEngine.AddJob(jobObj));
+      return res == null ? Guid.Empty : res.Obj.Id;
     }
 
     public byte[] TryEndExecuteEngine(Guid guid) {
-      IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(address);
-      ResponseObject<JobResult> response = executionEngineFacade.GetLastResult(guid, false);
-      if (response.Success && response.Obj != null) {
+      ResponseObject<JobResult> response = SavelyExecute(() => executionEngine.GetLastResult(guid, false));
+      if (response != null &&
+        response.Success && response.Obj != null) {
         HeuristicLab.Hive.Engine.Job restoredJob = (HeuristicLab.Hive.Engine.Job)PersistenceManager.RestoreFromGZip(response.Obj.Result);
         // Serialize the engine
@@ -89,4 +93,5 @@
       job.Engine.OperatorGraph.AddOperator(engine.OperatorGraph.InitialOperator);
       job.Engine.OperatorGraph.InitialOperator = engine.OperatorGraph.InitialOperator;
+      job.Engine.Reset();
 
       // Serialize the job
@@ -143,4 +148,29 @@
       return engine;
     }
+
+    private TResult SavelyExecute<TResult>(Func<TResult> a) where TResult : Response {
+      int retries = 0;
+      if (executionEngine == null)
+        executionEngine = ServiceLocator.CreateExecutionEngineFacade(address);
+
+      do {
+        try {
+          lock (connectionLock) {
+            return a();
+          }
+        }
+        catch (TimeoutException) {
+          retries++;
+          Thread.Sleep(TimeSpan.FromSeconds(RETRY_TIMEOUT_SEC));
+        }
+        catch (CommunicationException) {
+          executionEngine = ServiceLocator.CreateExecutionEngineFacade(address);
+          retries++;
+          Thread.Sleep(TimeSpan.FromSeconds(RETRY_TIMEOUT_SEC));
+        }
+      } while (retries < MAX_CONNECTION_RETRIES);
+      Logger.Warn("Reached max connection retries");
+      return null;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Grid/3.2/JobManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid/3.2/JobManager.cs	(revision 2071)
+++ trunk/sources/HeuristicLab.Grid/3.2/JobManager.cs	(revision 2073)
@@ -42,5 +42,4 @@
 
     private IGridServer server;
-    private string address;
     private object waitingQueueLock = new object();
     private Queue<AsyncGridResult> waitingJobs = new Queue<AsyncGridResult>();
@@ -108,5 +107,5 @@
       }
       catch (Exception e) {
-        Trace.TraceError("Exception " + e + " in JobManager.StartEngines() killed the start-engine thread\n" + e.StackTrace);
+        HeuristicLab.Tracing.Logger.Error("Exception " + e + " in JobManager.StartEngines() killed the start-engine thread\n" + e.StackTrace);
       }
     }
@@ -150,5 +149,5 @@
       }
       catch (Exception e) {
-        Trace.TraceError("Exception " + e + " in JobManager.GetResults() killed the results-gathering thread\n" + e.StackTrace);
+        HeuristicLab.Tracing.Logger.Error("Exception " + e + " in JobManager.GetResults() killed the results-gathering thread\n" + e.StackTrace);
       }
     }
Index: trunk/sources/HeuristicLab.Grid/3.2/ProcessingEngine.cs
===================================================================
--- trunk/sources/HeuristicLab.Grid/3.2/ProcessingEngine.cs	(revision 2071)
+++ trunk/sources/HeuristicLab.Grid/3.2/ProcessingEngine.cs	(revision 2073)
@@ -27,5 +27,4 @@
 using System.Xml;
 using System.Threading;
-using System.Diagnostics;
 
 namespace HeuristicLab.Grid {
@@ -82,5 +81,5 @@
         } catch(Exception ex) {
           errorMessage = CreateErrorMessage(ex);
-          Trace.TraceWarning(errorMessage);
+          HeuristicLab.Tracing.HiveLogger.Error(errorMessage);
           // push operation on stack again
           myExecutionStack.Push(atomicOperation);
Index: trunk/sources/HeuristicLab.sln
===================================================================
--- trunk/sources/HeuristicLab.sln	(revision 2071)
+++ trunk/sources/HeuristicLab.sln	(revision 2073)
@@ -3862,5 +3862,6 @@
 		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU
 		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU
-		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU
+		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|x86.ActiveCfg = Debug|x86
+		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|x86.Build.0 = Debug|x86
 		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
