Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/10 14:17:20 (14 years ago)
Author:
cneumuel
Message:

replaced transaction- and context management from Spring-advice by custom context management (see ContextFactory) (#1098)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ClientCommunicator.cs

    r4091 r4092  
    4040  public class ClientCommunicator : IClientCommunicator,
    4141    IInternalClientCommunicator {
    42     private static Dictionary<Guid, DateTime> lastHeartbeats =
    43       new Dictionary<Guid, DateTime>();
    44     private static Dictionary<Guid, int> newAssignedJobs =
    45       new Dictionary<Guid, int>();
    46     private static Dictionary<Guid, int> pendingJobs =
    47       new Dictionary<Guid, int>();
    48 
    49     private static ReaderWriterLockSlim heartbeatLock =
    50       new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
     42    private static Dictionary<Guid, DateTime> lastHeartbeats = new Dictionary<Guid, DateTime>();
     43    private static Dictionary<Guid, int> newAssignedJobs = new Dictionary<Guid, int>();
     44    private static Dictionary<Guid, int> pendingJobs = new Dictionary<Guid, int>();
     45
     46    private static ReaderWriterLockSlim heartbeatLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
    5147
    5248    //private ISessionFactory factory;
     
    8177      Logger.Debug("Server Heartbeat ticked");
    8278
     79      // [chn] why is transaction management done here
    8380      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
    84 
    8581        List<ClientDto> allClients = new List<ClientDto>(DaoLocator.ClientDao.FindAll());
    8682
     
    144140        }
    145141        CheckForPendingJobs();
    146         DaoLocator.DestroyContext();
     142//        DaoLocator.DestroyContext();
    147143        scope.Complete();
    148144      }
     
    595591    }
    596592
    597 
    598593    /// <summary>
    599594    /// the client can send job results during calculating
     
    616611    }
    617612
    618 
    619613    public ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
    620614      return ProcessJobResult(clientId, jobId, result, percentage, exception, false);
     
    628622    /// <returns></returns>                       
    629623    public Response Logout(Guid clientId) {
    630 
    631624      Logger.Info("Client logged out " + clientId);
    632625
     
    720713
    721714      return response;
    722 
    723715    }
    724716
Note: See TracChangeset for help on using the changeset viewer.