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)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3
Files:
4 deleted
11 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
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/DaoLocator.cs

    r4091 r4092  
    6262      }
    6363    }
    64 
    65     public static void DestroyContext() {
    66       if (ContextFactory.IsContextNull()) {
    67         ContextFactory.Context.Dispose();
    68         ContextFactory.Context = null;
    69       }
    70     }
    71 
    7264  }
    7365}
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/DbTestApp.cs

    r4091 r4092  
    3333using HeuristicLab.PluginInfrastructure;
    3434using HeuristicLab.Tracing;
     35using HeuristicLab.Hive.Server.DataAccess;
    3536
    3637namespace HeuristicLab.Hive.Server {
    3738  [Application("Hive DB Test App", "Test Application for the Hive DataAccess Layer")]
    3839  internal class HiveDbTestApplication : ApplicationBase {
     40    private IContextFactory contextFactory = ServiceLocator.GetContextFactory();
     41
    3942    /*private void TestJobStreaming() {
    4043      ISessionFactory factory =
     
    150153
    151154      JobDto job = new JobDto {
    152                                 Client = c1,
    153                                 CoresNeeded = 2,
    154                                 DateCreated = DateTime.Now,
    155                                 MemoryNeeded = 500,
    156                                 Percentage = 0,
    157                                 Priority = 1,
    158                                 State = State.offline
    159                               };
     155        Client = c1,
     156        CoresNeeded = 2,
     157        DateCreated = DateTime.Now,
     158        MemoryNeeded = 500,
     159        Percentage = 0,
     160        Priority = 1,
     161        State = State.offline
     162      };
    160163
    161164      job = DaoLocator.JobDao.Insert(job);
     
    214217    }
    215218
    216 
     219   
    217220    public override void Run() {
    218221      //TestClientGroupAdapter();
     
    221224      //TestJobResultStreaming();
    222225      //TestJobResultDeserialization();
    223 
    224       //if (ContextFactory.Context.DatabaseExists())
    225       //  ContextFactory.Context.DeleteDatabase();
    226       //ContextFactory.Context.CreateDatabase();
    227       //TestLINQImplementation();
    228       TestLinqFileHandling();
    229       //StressTest();
    230 
    231       //SpeedTest();
    232       //TestJobBytearrFetching();
    233       //TestJobStreamFetching();
     226      using (contextFactory.GetContext(false)) {
     227        if (contextFactory.CurrentContext.DatabaseExists())
     228          contextFactory.CurrentContext.DeleteDatabase();
     229        contextFactory.CurrentContext.CreateDatabase();
     230      }
     231
     232      using (contextFactory.GetContext()) {
     233        //TestLINQImplementation();
     234        TestLinqFileHandling();
     235
     236        //StressTest();
     237
     238        //SpeedTest();
     239        //TestJobBytearrFetching();
     240        //TestJobStreamFetching();
     241      }
     242
    234243    }
    235244
    236245    private void WriteToJobWithByte(object jobid) {
    237246      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
    238                                                            new TransactionOptions
    239                                                            {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})
    240         ) {
     247                                                           new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
    241248        Logger.Info("starting bytestuff for job " + jobid);
    242249        DaoLocator.JobDao.SetBinaryJobFile((Guid)jobid, jobmap[(Guid)jobid]);
     
    248255    private void UpdateJobStatus(object jobid) {
    249256      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
    250                                                            new TransactionOptions
    251                                                            {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})
    252         ) {
     257                                                           new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
    253258        Thread.Sleep(1500);
    254259        Logger.Info("starting now");
     
    267272      List<Thread> jobupdateThreads = new List<Thread>();
    268273      List<Thread> jobProgressThreads = new List<Thread>();
    269      
     274
    270275      Random r = new Random();
    271276      Stack<JobDto> jobs = new Stack<JobDto>(DaoLocator.JobDao.FindAll());
    272277      Logger.Info("Fetched jobs");
    273       for (int x = 0; x < 10 && jobs.Count > 0; x++ ) {
     278      for (int x = 0; x < 10 && jobs.Count > 0; x++) {
    274279        Logger.Info("Creating data for Job");
    275280        JobDto job = jobs.Pop();
    276         byte[] jobarr = new byte[50*1024*1024];
     281        byte[] jobarr = new byte[50 * 1024 * 1024];
    277282        for (int i = 0; i < jobarr.Length; i++) {
    278           jobarr[i] = (byte) r.Next(255);
     283          jobarr[i] = (byte)r.Next(255);
    279284        }
    280285        jobmap.Add(job.Id, jobarr);
    281286      }
    282287      Logger.Info("filled");
    283       foreach(KeyValuePair<Guid, byte[]> kvp in jobmap) {
    284         Thread tjob = new Thread(new ParameterizedThreadStart(WriteToJobWithByte));     
     288      foreach (KeyValuePair<Guid, byte[]> kvp in jobmap) {
     289        Thread tjob = new Thread(new ParameterizedThreadStart(WriteToJobWithByte));
    285290        Thread tupdate = new Thread(new ParameterizedThreadStart(UpdateJobStatus));
    286291        jobupdateThreads.Add(tupdate);
     
    298303
    299304
    300     private
    301       void TestJobStreamFetching() {
     305    private void TestJobStreamFetching() {
    302306      //using (TransactionScope scope = new TransactionScope()) {
    303307
    304       HiveDataContext context = ContextFactory.Context;
    305 
    306       ContextFactory.Context.Connection.Open
    307         ();
    308       ContextFactory.Context.Transaction
    309         =
    310         ContextFactory.Context.Connection.BeginTransaction
    311           ();
    312 
     308      HiveDataContext context = contextFactory.CurrentContext as HiveDataContext;
     309
     310      context.Connection.Open();
     311      context.Transaction = context.Connection.BeginTransaction();
    313312
    314313      ClientFacade facade = new ClientFacade();
    315 
    316314      Stream stream = facade.SendStreamedJob(new Guid("F5CFB334-66A0-417C-A585-71711BA21D3F"));
    317315
    318 
    319316      byte[] buffer = new byte[3024];
    320 
    321317      int read = 0;
    322 
    323       while ((
    324                read
    325                =
    326                stream.Read
    327                  (
    328                  buffer
    329                  , 0,
    330                  buffer.Length
    331                  )) > 0) {}
    332 
    333       stream.Close
    334         ();
     318      while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) { }
     319      stream.Close();
    335320
    336321      //Stream stream = DaoLocator.JobDao.GetSerializedJobStream(new Guid("bbb51f87-4e2f-4499-a9b6-884e589c78b6"));
     
    338323    }
    339324
    340     private
    341       void TestJobBytearrFetching() {
     325    private void TestJobBytearrFetching() {
    342326      byte[] arr = DaoLocator.JobDao.GetBinaryJobFile(new Guid("A3386907-2B3C-4976-BE07-04D660D40A5B"));
    343       Console.WriteLine
    344         (
    345         arr
    346         );
    347     }
    348 
    349     private
    350       void SpeedTest() {
     327      Console.WriteLine(arr);
     328    }
     329
     330    private void SpeedTest() {
    351331      DateTime start = new DateTime();
    352332
     
    356336
    357337      TimeSpan used = end - start;
    358       Console.WriteLine
    359         (
    360         used.TotalMilliseconds
    361         );
     338      Console.WriteLine(used.TotalMilliseconds);
    362339    }
    363340  }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs

    r4091 r4092  
    3333using HeuristicLab.Hive.Server.Core.InternalInterfaces;
    3434using System.Transactions;
     35using HeuristicLab.Hive.Server.LINQDataAccess;
     36using HeuristicLab.Hive.Server.DataAccess;
    3537
    3638namespace HeuristicLab.Hive.Server.Core {
    37   [ServiceBehavior(InstanceContextMode =
    38     InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
    39   public class ClientFacade: IClientFacade {
     39  [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
     40  public class ClientFacade : IClientFacade {
    4041
    41     public ClientFacade() {     
     42    public ClientFacade() {
    4243    }
    4344
    4445    private IClientCommunicator clientCommunicator = ServiceLocator.GetClientCommunicator();
    4546
     47    private IContextFactory contextFactory = ServiceLocator.GetContextFactory();
     48
    4649    #region IClientCommunicator Members
    4750
    4851    public Response Login(ClientDto clientInfo) {
    49       return clientCommunicator.Login(clientInfo);
     52      using (contextFactory.GetContext()) {
     53        return clientCommunicator.Login(clientInfo);
     54      }
    5055    }
    5156
    5257    public ResponseHB ProcessHeartBeat(HeartBeatData hbData) {
    53       return clientCommunicator.ProcessHeartBeat(hbData);
     58      using (contextFactory.GetContext()) {
     59        return clientCommunicator.ProcessHeartBeat(hbData);
     60      }
    5461    }
    5562
    5663    public ResponseJob SendJob(Guid clientId) {
    57       return clientCommunicator.SendJob(clientId);
     64      using (contextFactory.GetContext()) {
     65        return clientCommunicator.SendJob(clientId);
     66      }
    5867    }
    5968
    60     /*public ResponseSerializedJob SendSerializedJob(Guid clientId) {
    61       return clientCommunicator.SendSerializedJob(clientId);
    62     } */
    63 
    64     public ResponseResultReceived StoreFinishedJobResult(Guid clientId,
    65       Guid jobId,
    66       byte[] result,
    67       double percentage,
    68       Exception exception) {
    69       return clientCommunicator.StoreFinishedJobResult(clientId, jobId, result, percentage, exception);
     69    public ResponseResultReceived StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
     70      using (contextFactory.GetContext()) {
     71        return clientCommunicator.StoreFinishedJobResult(clientId, jobId, result, percentage, exception);
     72      }
    7073    }
    7174
    7275    public Response Logout(Guid clientId) {
    73       return clientCommunicator.Logout(clientId);
     76      using (contextFactory.GetContext()) {
     77        return clientCommunicator.Logout(clientId);
     78      }
    7479    }
    7580
    7681    public Response IsJobStillNeeded(Guid jobId) {
    77       return clientCommunicator.IsJobStillNeeded(jobId);
     82      using (contextFactory.GetContext()) {
     83        return clientCommunicator.IsJobStillNeeded(jobId);
     84      }
    7885    }
    7986
    8087    public ResponsePlugin SendPlugins(List<HivePluginInfoDto> pluginList) {
    81       return clientCommunicator.SendPlugins(pluginList);
     88      using (contextFactory.GetContext()) {
     89        return clientCommunicator.SendPlugins(pluginList);     
     90      }
    8291    }
    8392
    8493    public ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
    85       return clientCommunicator.ProcessSnapshot(clientId, jobId, result, percentage, exception);
     94      using (contextFactory.GetContext()) {
     95        return clientCommunicator.ProcessSnapshot(clientId, jobId, result, percentage, exception);
     96      }
    8697    }
    8798
    8899
    89100    public ResponseCalendar GetCalendar(Guid clientId) {
    90       return clientCommunicator.GetCalendar(clientId);
     101      using (contextFactory.GetContext()) {
     102        return clientCommunicator.GetCalendar(clientId);
     103      }
    91104    }
    92105
    93     public Response SetCalendarStatus(Guid clientId, CalendarState state) {
    94       return clientCommunicator.SetCalendarStatus(clientId, state);     
     106    public Response SetCalendarStatus(Guid clientId, CalendarState state) {
     107      using (contextFactory.GetContext()) {
     108        return clientCommunicator.SetCalendarStatus(clientId, state);
     109      }
    95110    }
    96111    #endregion
     
    98113    #region IClientFacade Members
    99114
    100     [SpringTransaction(UserTransaction = true)]
     115    /// <summary>
     116    /// Do not use automatic transactions here
     117    /// </summary>
    101118    public Stream SendStreamedJob(Guid clientId) {
    102       MultiStream stream = new MultiStream();
     119      using (contextFactory.GetContext(false)) {
     120        MultiStream stream = new MultiStream();
    103121
    104       ResponseJob job = null;
     122        ResponseJob job = null;
    105123
    106       job = this.SendJob(clientId);     
     124        job = this.SendJob(clientId);
    107125
    108       //first send response
    109       stream.AddStream(new StreamedObject<ResponseJob>(job));
     126        //first send response
     127        stream.AddStream(new StreamedObject<ResponseJob>(job));
    110128
    111       IJobManager jobManager = ServiceLocator.GetJobManager();
    112       IInternalJobManager internalJobManager = (IInternalJobManager) jobManager;
    113      
    114       //second stream the job binary data
    115       MemoryStream memoryStream = new MemoryStream();     
    116       if(job.Job != null)
    117         stream.AddStream(new MemoryStream(internalJobManager.GetSerializedJobDataById(job.Job.Id)));
    118      
    119       OperationContext clientContext = OperationContext.Current;
     129        IJobManager jobManager = ServiceLocator.GetJobManager();
     130        IInternalJobManager internalJobManager = (IInternalJobManager)jobManager;
     131
     132        //second stream the job binary data
     133        MemoryStream memoryStream = new MemoryStream();
     134        if (job.Job != null)
     135          stream.AddStream(new MemoryStream(internalJobManager.GetSerializedJobDataById(job.Job.Id)));
     136
     137        OperationContext clientContext = OperationContext.Current;
    120138        clientContext.OperationCompleted += new EventHandler(delegate(object sender, EventArgs args) {
    121139          if (stream != null) {
     
    124142        });
    125143
    126       return stream;
     144        return stream;
     145      }
    127146    }
    128147
    129148    public Stream SendStreamedPlugins(List<HivePluginInfoDto> pluginList) {
    130       return new StreamedObject<ResponsePlugin>(this.SendPlugins(pluginList));
     149      using (contextFactory.GetContext()) {
     150        return new StreamedObject<ResponsePlugin>(this.SendPlugins(pluginList));
     151      }
    131152    }
    132153
    133154    public ResponseResultReceived StoreFinishedJobResultStreamed(Stream stream) {
    134       return ((IInternalClientCommunicator)clientCommunicator).ProcessJobResult(stream, true);
    135     }
     155      using (contextFactory.GetContext()) {
     156        return ((IInternalClientCommunicator)clientCommunicator).ProcessJobResult(stream, true);
     157      }
     158    }
    136159
    137160    public ResponseResultReceived ProcessSnapshotStreamed(Stream stream) {
    138       return ((IInternalClientCommunicator)clientCommunicator).ProcessJobResult(stream, false);
     161      using (contextFactory.GetContext()) {
     162        return ((IInternalClientCommunicator)clientCommunicator).ProcessJobResult(stream, false); 
     163      }
    139164    }
    140165    #endregion
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ExecutionEngineFacade.cs

    r4091 r4092  
    2727using HeuristicLab.Hive.Contracts;
    2828using HeuristicLab.Hive.Contracts.BusinessObjects;
     29using HeuristicLab.Hive.Server.DataAccess;
    2930
    3031namespace HeuristicLab.Hive.Server.Core {
    31   public class ExecutionEngineFacade: IExecutionEngineFacade {
     32  public class ExecutionEngineFacade : IExecutionEngineFacade {
    3233
    33     private IJobManager jobManager =
    34       ServiceLocator.GetJobManager();
     34    private IJobManager jobManager = ServiceLocator.GetJobManager();
     35    private IContextFactory contextFactory = ServiceLocator.GetContextFactory();
    3536
    3637    public ExecutionEngineFacade() {
    37      
    3838    }
    3939
     
    4141
    4242    public ResponseObject<JobDto> AddJob(SerializedJob job) {
    43       return jobManager.AddNewJob(job);
     43      using (contextFactory.GetContext()) {
     44        return jobManager.AddNewJob(job);
     45      }
    4446    }
    4547
    46     public ResponseObject<JobDto> AddJobWithGroupStrings(SerializedJob job, IEnumerable<string> resources) {     
    47       return jobManager.AddJobWithGroupStrings(job, resources);
     48    public ResponseObject<JobDto> AddJobWithGroupStrings(SerializedJob job, IEnumerable<string> resources) {
     49      using (contextFactory.GetContext()) {
     50        return jobManager.AddJobWithGroupStrings(job, resources);
     51      }
    4852    }
    4953
    5054    public Response RequestSnapshot(Guid jobId) {
    51       return jobManager.RequestSnapshot(jobId);
     55      using (contextFactory.GetContext()) {
     56        return jobManager.RequestSnapshot(jobId);
     57      }
    5258    }
    5359
    54     public ResponseObject<SerializedJob>
    55       GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
    56       return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
     60    public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
     61      using (contextFactory.GetContext()) {
     62        return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
     63      }
    5764    }
    5865
    5966    public Response AbortJob(Guid jobId) {
    60       return jobManager.AbortJob(jobId);
     67      using (contextFactory.GetContext()) {
     68        return jobManager.AbortJob(jobId);
     69      }
    6170    }
    6271
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs

    r4091 r4092  
    3030using HeuristicLab.Hive.Server.Core.InternalInterfaces;
    3131using System.ServiceModel;
     32using HeuristicLab.Hive.Server.DataAccess;
    3233
    3334
    3435namespace HeuristicLab.Hive.Server.Core {
    35   public class ServerConsoleFacade: IServerConsoleFacade {
    36     private IClientManager clientManager =
    37       ServiceLocator.GetClientManager();
    38 
    39     private IJobManager jobManager =
    40       ServiceLocator.GetJobManager();
     36  public class ServerConsoleFacade : IServerConsoleFacade {
     37    private IClientManager clientManager = ServiceLocator.GetClientManager();
     38
     39    private IJobManager jobManager = ServiceLocator.GetJobManager();
    4140
    4241    private IHivePermissionManager secMan = ServiceLocator.GetHivePermissionManager();
    4342
     43    private IContextFactory contextFactory = ServiceLocator.GetContextFactory();
     44
    4445    public Guid sessionID = Guid.Empty;
    4546
    46     public ServerConsoleFacade() {     
     47    public ServerConsoleFacade() {
    4748    }
    4849
    4950    public Response Login(string username, string password) {
    50       Response resp = new Response();
    51      
    52       sessionID = secMan.Login(username, password);
    53       if (sessionID == Guid.Empty) {
    54         resp.Success = false;
    55         resp.StatusMessage = ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_FAILED;
    56       } else {
    57         resp.Success = true;
    58         resp.StatusMessage =
    59           ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
    60       }
    61       return resp;
     51      using (contextFactory.GetContext()) {
     52        Response resp = new Response();
     53
     54        sessionID = secMan.Login(username, password);
     55        if (sessionID == Guid.Empty) {
     56          resp.Success = false;
     57          resp.StatusMessage = ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_FAILED;
     58        } else {
     59          resp.Success = true;
     60          resp.StatusMessage =
     61            ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
     62        }
     63        return resp;
     64      }
    6265    }
    6366
    6467
    6568    public ResponseList<ClientDto> GetAllClients() {
    66       secMan.Authorize("AccessClients", sessionID, Guid.Empty);
    67       return clientManager.GetAllClients();
     69      using (contextFactory.GetContext()) {
     70        secMan.Authorize("AccessClients", sessionID, Guid.Empty);
     71        return clientManager.GetAllClients();
     72      }
    6873    }
    6974
    7075    public ResponseList<ClientGroupDto> GetAllClientGroups() {
    71       //secMan.Authorize("AccessClientGroup", sessionID, Guid.Empty);
    72       return clientManager.GetAllClientGroups();
     76      using (contextFactory.GetContext()) {
     77        //secMan.Authorize("AccessClientGroup", sessionID, Guid.Empty);
     78        return clientManager.GetAllClientGroups();
     79      }
    7380    }
    7481
    7582    public ResponseList<UpTimeStatisticsDto> GetAllUpTimeStatistics() {
    76       secMan.Authorize("AccessStatistics", sessionID, Guid.Empty);
    77       return clientManager.GetAllUpTimeStatistics();
     83      using (contextFactory.GetContext()) {
     84        secMan.Authorize("AccessStatistics", sessionID, Guid.Empty);
     85        return clientManager.GetAllUpTimeStatistics();
     86      }
    7887    }
    7988
    8089    public ResponseObject<ClientGroupDto> AddClientGroup(ClientGroupDto clientGroup) {
    81       secMan.Authorize("AddClientGroup", sessionID, Guid.Empty);
    82       return clientManager.AddClientGroup(clientGroup);
     90      using (contextFactory.GetContext()) {
     91        secMan.Authorize("AddClientGroup", sessionID, Guid.Empty);
     92        return clientManager.AddClientGroup(clientGroup);
     93      }
    8394    }
    8495
    8596    public Response AddResourceToGroup(Guid clientGroupId, ResourceDto resource) {
    86       secMan.Authorize("AddResource", sessionID, Guid.Empty);               
    87       return clientManager.AddResourceToGroup(clientGroupId, resource);
     97      using (contextFactory.GetContext()) {
     98        secMan.Authorize("AddResource", sessionID, Guid.Empty);
     99        return clientManager.AddResourceToGroup(clientGroupId, resource);
     100      }
    88101    }
    89102
    90103    public Response DeleteResourceFromGroup(Guid clientGroupId, Guid resourceId) {
     104      using (contextFactory.GetContext()) {
    91105        return clientManager.DeleteResourceFromGroup(clientGroupId, resourceId);
     106      }
    92107    }
    93108
    94109    public ResponseList<JobDto> GetAllJobs() {
    95       secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
    96       return jobManager.GetAllJobs();
     110      using (contextFactory.GetContext()) {
     111        secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
     112        return jobManager.GetAllJobs();
     113      }
    97114    }
    98115
    99116    public ResponseList<JobDto> GetAllJobsWithFilter(State jobState, int offset, int count) {
    100       secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
    101       return jobManager.GetAllJobsWithFilter(jobState, offset, count);
     117      using (contextFactory.GetContext()) {
     118        secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
     119        return jobManager.GetAllJobsWithFilter(jobState, offset, count);
     120      }
    102121    }
    103122
    104123    public ResponseObject<JobDto> GetJobById(Guid jobId) {
    105       secMan.Authorize("AccessJobs", sessionID, jobId);
    106       return jobManager.GetJobById(jobId);
     124      using (contextFactory.GetContext()) {
     125        secMan.Authorize("AccessJobs", sessionID, jobId);
     126        return jobManager.GetJobById(jobId);
     127      }
    107128    }
    108129
    109130    public ResponseObject<JobDto> GetJobByIdWithDetails(Guid jobId) {
    110       secMan.Authorize("AccessJobs", sessionID, jobId);
    111       return jobManager.GetJobByIdWithDetails(jobId);
     131      using (contextFactory.GetContext()) {
     132        secMan.Authorize("AccessJobs", sessionID, jobId);
     133        return jobManager.GetJobByIdWithDetails(jobId);
     134      }
    112135    }
    113136
    114137    public ResponseObject<JobDto> AddNewJob(SerializedJob job) {
    115       secMan.Authorize("AddJob", sessionID, job.JobInfo.Id);
    116       return jobManager.AddNewJob(job);
     138      using (contextFactory.GetContext()) {
     139        secMan.Authorize("AddJob", sessionID, job.JobInfo.Id);
     140        return jobManager.AddNewJob(job);
     141      }
    117142    }
    118143
    119144    public ResponseObject<JobDto> GetLastJobResultOf(Guid jobId) {
    120       secMan.Authorize("AccessJobResults", sessionID, jobId);
    121       return jobManager.GetLastJobResultOf(jobId);
     145      using (contextFactory.GetContext()) {
     146        secMan.Authorize("AccessJobResults", sessionID, jobId);
     147        return jobManager.GetLastJobResultOf(jobId);
     148      }
    122149    }
    123150
    124151    public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) {
    125       secMan.Authorize("AccessJobResults", sessionID, jobId);
    126       return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
     152      using (contextFactory.GetContext()) {
     153        secMan.Authorize("AccessJobResults", sessionID, jobId);
     154        return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
     155      }
    127156    }
    128157
    129158    public ResponseList<JobResult> GetAllJobResults(Guid jobId) {
    130       secMan.Authorize("AccessJobResults", sessionID, jobId); 
    131       return jobManager.GetAllJobResults(jobId);
     159      using (contextFactory.GetContext()) {
     160        secMan.Authorize("AccessJobResults", sessionID, jobId);
     161        return jobManager.GetAllJobResults(jobId);
     162      }
    132163    }
    133164
    134165    public Response RemoveJob(Guid jobId) {
    135       secMan.Authorize("RemoveJob", sessionID, jobId);
    136       return jobManager.RemoveJob(jobId);
     166      using (contextFactory.GetContext()) {
     167        secMan.Authorize("RemoveJob", sessionID, jobId);
     168        return jobManager.RemoveJob(jobId);
     169      }
    137170    }
    138171
    139172    public Response RequestSnapshot(Guid jobId) {
    140       secMan.Authorize("AccessJobResults", sessionID, jobId); 
    141       return jobManager.RequestSnapshot(jobId);
     173      using (contextFactory.GetContext()) {
     174        secMan.Authorize("AccessJobResults", sessionID, jobId);
     175        return jobManager.RequestSnapshot(jobId);
     176      }
    142177    }
    143178
    144179    public Response AbortJob(Guid jobId) {
    145       secMan.Authorize("AbortJob", sessionID, Guid.Empty);
    146       return jobManager.AbortJob(jobId);
     180      using (contextFactory.GetContext()) {
     181        secMan.Authorize("AbortJob", sessionID, Guid.Empty);
     182        return jobManager.AbortJob(jobId);
     183      }
    147184    }
    148185
    149186    public ResponseObject<List<ClientGroupDto>> GetAllGroupsOfResource(Guid resourceId) {
    150       secMan.Authorize("AccessUserGroup", sessionID, Guid.Empty);
    151       return clientManager.GetAllGroupsOfResource(resourceId);
     187      using (contextFactory.GetContext()) {
     188        secMan.Authorize("AccessUserGroup", sessionID, Guid.Empty);
     189        return clientManager.GetAllGroupsOfResource(resourceId);
     190      }
    152191    }
    153192
    154193    public Response DeleteClientGroup(Guid clientGroupId) {
    155       secMan.Authorize("DeleteClientGroup", sessionID, Guid.Empty);
    156       return clientManager.DeleteClientGroup(clientGroupId);
     194      using (contextFactory.GetContext()) {
     195        secMan.Authorize("DeleteClientGroup", sessionID, Guid.Empty);
     196        return clientManager.DeleteClientGroup(clientGroupId);
     197      }
    157198    }
    158199
    159200    public ResponseList<ProjectDto> GetAllProjects() {
    160       secMan.Authorize("AccessProjects", sessionID, Guid.Empty);
    161       return jobManager.GetAllProjects();
     201      using (contextFactory.GetContext()) {
     202        secMan.Authorize("AccessProjects", sessionID, Guid.Empty);
     203        return jobManager.GetAllProjects();
     204      }
    162205    }
    163206
    164207    public Response CreateProject(ProjectDto project) {
    165       secMan.Authorize("CreateProjects", sessionID, Guid.Empty);
    166       return jobManager.CreateProject(project);
     208      using (contextFactory.GetContext()) {
     209        secMan.Authorize("CreateProjects", sessionID, Guid.Empty);
     210        return jobManager.CreateProject(project);
     211      }
    167212    }
    168213
    169214    public Response ChangeProject(ProjectDto project) {
    170       secMan.Authorize("ChangeProjects", sessionID, Guid.Empty);
    171       return jobManager.ChangeProject(project);
     215      using (contextFactory.GetContext()) {
     216        secMan.Authorize("ChangeProjects", sessionID, Guid.Empty);
     217        return jobManager.ChangeProject(project);
     218      }
    172219    }
    173220
    174221    public Response DeleteProject(Guid projectId) {
    175       secMan.Authorize("DeleteProjects", sessionID, projectId);
    176       return jobManager.DeleteProject(projectId);
     222      using (contextFactory.GetContext()) {
     223        secMan.Authorize("DeleteProjects", sessionID, projectId);
     224        return jobManager.DeleteProject(projectId);
     225      }
    177226    }
    178227
    179228    public ResponseList<JobDto> GetJobsByProject(Guid projectId) {
    180       secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
    181       return jobManager.GetJobsByProject(projectId);
     229      using (contextFactory.GetContext()) {
     230        secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
     231        return jobManager.GetJobsByProject(projectId);
     232      }
    182233    }
    183234
    184235    public ResponseList<AppointmentDto> GetUptimeCalendarForResource(Guid guid) {
    185       return clientManager.GetUptimeCalendarForResource(guid);
     236      using (contextFactory.GetContext()) {
     237        return clientManager.GetUptimeCalendarForResource(guid);
     238      }
    186239    }
    187240
    188241    public Response SetUptimeCalendarForResource(Guid guid, IEnumerable<AppointmentDto> appointments, bool isForced) {
    189       return clientManager.SetUptimeCalendarForResource(guid, appointments, isForced);
     242      using (contextFactory.GetContext()) {
     243        return clientManager.SetUptimeCalendarForResource(guid, appointments, isForced);
     244      }
    190245    }
    191246
    192247    public ResponseObject<JobDto> AddJobWithGroupStrings(SerializedJob job, IEnumerable<string> resources) {
    193       return jobManager.AddJobWithGroupStrings(job, resources);
     248      using (contextFactory.GetContext()) {
     249        return jobManager.AddJobWithGroupStrings(job, resources);
     250      }
    194251    }
    195252  }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/HeuristicLab.Hive.Server.Core-3.3.csproj

    r4091 r4092  
    112112    <Compile Include="Authorization\PolicyCollection.cs" />
    113113    <Compile Include="ClientCommunicator.cs" />
    114     <Compile Include="ClientFacade.cs" />
     114    <Compile Include="Facades\ClientFacade.cs" />
    115115    <Compile Include="ClientManager.cs" />
    116116    <Compile Include="DaoLocator.cs" />
    117117    <Compile Include="DbTestApp.cs" />
    118118    <Compile Include="DefaultScheduler.cs" />
    119     <Compile Include="ExecutionEngineFacade.cs" />
     119    <Compile Include="Facades\ExecutionEngineFacade.cs" />
    120120    <Compile Include="Authorization\HivePermissionManager.cs" />
    121121    <Compile Include="HiveServerCorePlugin.cs" />
     
    128128    <Compile Include="LifecycleManager.cs" />
    129129    <Compile Include="Properties\AssemblyInfo.cs" />
    130     <Compile Include="ServerConsoleFacade.cs" />
     130    <Compile Include="Facades\ServerConsoleFacade.cs" />
    131131    <Compile Include="ServiceLocator.cs" />
    132132    <Compile Include="Properties\Settings.Designer.cs">
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/JobManager.cs

    r4060 r4092  
    3737using System.Transactions;
    3838using HeuristicLab.Hive.Server.LINQDataAccess;
    39 using IsolationLevel=System.Transactions.IsolationLevel;
     39using IsolationLevel = System.Transactions.IsolationLevel;
    4040
    4141namespace HeuristicLab.Hive.Server.Core {
     
    5959
    6060
    61     private void checkForDeadJobs() {
     61    private void CheckForDeadJobs() {
    6262      Logger.Info("Searching for dead Jobs");
    63       using (
    64         TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
    65                                                       new TransactionOptions
    66                                                       {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})) {
     63
     64      // [chn] why is transaction management done here?
     65      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
    6766        List<JobDto> allJobs = new List<JobDto>(DaoLocator.JobDao.FindAll());
    6867        foreach (JobDto curJob in allJobs) {
     
    7372        scope.Complete();
    7473      }
    75       DaoLocator.DestroyContext();
     74      // DaoLocator.DestroyContext();
    7675    }
    7776
    7877    private void lifecycleManager_OnStartup(object sender, EventArgs e) {
    7978      Logger.Info("Startup Event Fired, Checking DB for consistency");
    80       checkForDeadJobs();
     79      CheckForDeadJobs();
    8180      Logger.Info("Startup Event Done");
    8281    }
     
    8483    private void lifecycleManager_OnShutdown(object sender, EventArgs e) {
    8584      Logger.Info("Startup Event Fired, Checking DB for consistency");
    86       checkForDeadJobs();
     85      CheckForDeadJobs();
    8786      Logger.Info("Startup Event Done");
    8887    }
     
    129128        response.Success = true;
    130129        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_GET_JOB_BY_ID;
    131       }
    132       else {
     130      } else {
    133131        response.Success = false;
    134132        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
     
    146144
    147145        job.Obj.Client = DaoLocator.ClientDao.GetClientForJob(jobId);
    148       }
    149       else {
     146      } else {
    150147        job.Success = false;
    151148        job.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST;
     
    196193        response.Obj = job.JobInfo;
    197194        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_ADDED;
    198       }
    199       else {
     195      } else {
    200196        response.Success = false;
    201197        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_NULL;
     
    255251
    256252      //if it's NOT a snapshot, NEITHER request NOR is it finished
    257       if(!requested && !snapshot && job.State != State.finished) {     
     253      if (!requested && !snapshot && job.State != State.finished) {
    258254        response.Success = true;
    259255        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE;
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/LifecycleManager.cs

    r4060 r4092  
    3737    private static event EventHandler OnStartup;
    3838    private static event EventHandler OnShutdown;
     39
    3940    #region ILifecycleManager Members
    4041
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Properties/AssemblyInfo.cs

    r4091 r4092  
    5555// by using the '*' as shown below:
    5656// [assembly: AssemblyVersion("1.0.*")]
    57 [assembly: AssemblyVersion("3.3.0.4078")]
    58 [assembly: AssemblyFileVersion("3.3.0.4078")]
    59 [assembly: AssemblyBuildDate("2010/07/23 09:04:35")]
     57[assembly: AssemblyVersion("3.3.0.4091")]
     58[assembly: AssemblyFileVersion("3.3.0.4091")]
     59[assembly: AssemblyBuildDate("2010/07/23 14:14:54")]
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/ServiceLocator.cs

    r4060 r4092  
    3131using HeuristicLab.Security.Contracts.Interfaces;
    3232
    33 /// <summary>
    34 /// The service locator for the server core
    35 /// </summary>
    36 public class ServiceLocator {
    37   private static IClientManager clientManager = null;
     33namespace HeuristicLab.Hive.Server.Core {
     34  /// <summary>
     35  /// The service locator for the server core
     36  /// </summary>
     37  public class ServiceLocator {
     38    private static IClientManager clientManager = null;
    3839
    39   private static IJobManager jobManager = null;
     40    private static IJobManager jobManager = null;
    4041
    41   private static IClientCommunicator clientCommunicator = null;
     42    private static IClientCommunicator clientCommunicator = null;
    4243
    43   private static ILifecycleManager lifecycleManager = null;
     44    private static ILifecycleManager lifecycleManager = null;
    4445
    45   private static ISessionFactory sessionFactory = null;
     46    private static ISessionFactory sessionFactory = null;
    4647
    47   private static IScheduler scheduler = null;
     48    private static IScheduler scheduler = null;
    4849
    49   private static IPermissionManager permManager = null;
     50    private static IPermissionManager permManager = null;
    5051
    51   private static IHivePermissionManager hivePermManager = null;
     52    private static IHivePermissionManager hivePermManager = null;
    5253
    53   /// <summary>
    54   /// Gets the client manager
    55   /// </summary>
    56   /// <returns></returns>
    57   [MethodImpl(MethodImplOptions.Synchronized)]
    58   public static IClientManager GetClientManager() {
    59     if (clientManager == null)
    60       clientManager = new ClientManager();
     54    private static IContextFactory contextFactory = null;
    6155
    62     return clientManager;
    63   }
     56    /// <summary>
     57    /// Gets the client manager
     58    /// </summary>
     59    /// <returns></returns>
     60    [MethodImpl(MethodImplOptions.Synchronized)]
     61    public static IClientManager GetClientManager() {
     62      if (clientManager == null)
     63        clientManager = new ClientManager();
    6464
    65   /// <summary>
    66   /// Gets the job manager
    67   /// </summary>
    68   /// <returns></returns>
    69   [MethodImpl(MethodImplOptions.Synchronized)]
    70   public static IJobManager GetJobManager() {
    71     if (jobManager == null)
    72       jobManager = new JobManager();
    73 
    74     return jobManager;
    75   }
    76 
    77   /// <summary>
    78   /// Gets the client Communicator
    79   /// </summary>
    80   /// <returns></returns>
    81   [MethodImpl(MethodImplOptions.Synchronized)]
    82   public static IClientCommunicator GetClientCommunicator() {
    83     if (clientCommunicator == null)
    84       clientCommunicator = new ClientCommunicator();
    85 
    86     return clientCommunicator;
    87   }
    88 
    89   /// <summary>
    90   /// Gets the lifecycle manager
    91   /// </summary>
    92   /// <returns></returns>
    93   [MethodImpl(MethodImplOptions.Synchronized)]
    94   public static ILifecycleManager GetLifecycleManager() {
    95     if (lifecycleManager == null) {
    96       lifecycleManager = new LifecycleManager();
    97     }
    98     return lifecycleManager;
    99   }
    100 
    101   /// <summary>
    102   /// Gets the db session factory
    103   /// </summary>
    104   /// <returns></returns>
    105   [MethodImpl(MethodImplOptions.Synchronized)]
    106   public static ISessionFactory GetSessionFactory() {
    107     if (sessionFactory == null) {
    108       sessionFactory =
    109         ApplicationManager.Manager.GetInstances<ISessionFactory>().First();
    110 
    111       sessionFactory.DbConnectionType =
    112         typeof(SqlConnection);
    113      
    114       sessionFactory.DbConnectionString =
    115         HeuristicLab.Hive.Server.Core.Properties.Settings.Default.HiveServerConnectionString;
     65      return clientManager;
    11666    }
    11767
    118     return sessionFactory;
    119   }
     68    /// <summary>
     69    /// Gets the job manager
     70    /// </summary>
     71    /// <returns></returns>
     72    [MethodImpl(MethodImplOptions.Synchronized)]
     73    public static IJobManager GetJobManager() {
     74      if (jobManager == null)
     75        jobManager = new JobManager();
    12076
    121   /// <summary>
    122   /// Gets the scheduler
    123   /// </summary>
    124   /// <returns></returns>
    125   [MethodImpl(MethodImplOptions.Synchronized)]
    126   public static IScheduler GetScheduler() {
    127     if (scheduler == null) {
    128       scheduler = ApplicationManager.Manager.GetInstances<IScheduler>().First();
     77      return jobManager;
    12978    }
    13079
    131     return scheduler;
    132   }
     80    /// <summary>
     81    /// Gets the client Communicator
     82    /// </summary>
     83    /// <returns></returns>
     84    [MethodImpl(MethodImplOptions.Synchronized)]
     85    public static IClientCommunicator GetClientCommunicator() {
     86      if (clientCommunicator == null)
     87        clientCommunicator = new ClientCommunicator();
    13388
    134   /// <summary>
    135   /// Gets the permission manager
    136   /// </summary>
    137   /// <returns></returns>
    138   [MethodImpl(MethodImplOptions.Synchronized)] 
    139   public static IPermissionManager GetPermissionManager() {
    140     if (permManager == null)
    141       permManager = ApplicationManager.Manager.GetInstances<IPermissionManager>().First();
    142     return permManager;
    143    
    144   }
     89      return clientCommunicator;
     90    }
    14591
    146   /// <summary>
    147   /// Gets the permission manager
    148   /// </summary>
    149   /// <returns></returns>
    150   [MethodImpl(MethodImplOptions.Synchronized)]
    151   public static IHivePermissionManager GetHivePermissionManager() {
    152     if (hivePermManager == null)
    153       hivePermManager = ApplicationManager.Manager.GetInstances<IHivePermissionManager>().First();
    154     return hivePermManager;
     92    /// <summary>
     93    /// Gets the lifecycle manager
     94    /// </summary>
     95    /// <returns></returns>
     96    [MethodImpl(MethodImplOptions.Synchronized)]
     97    public static ILifecycleManager GetLifecycleManager() {
     98      if (lifecycleManager == null) {
     99        lifecycleManager = new LifecycleManager();
     100      }
     101      return lifecycleManager;
     102    }
    155103
     104    /// <summary>
     105    /// Gets the db session factory
     106    /// </summary>
     107    /// <returns></returns>
     108    [MethodImpl(MethodImplOptions.Synchronized)]
     109    public static ISessionFactory GetSessionFactory() {
     110      if (sessionFactory == null) {
     111        sessionFactory = ApplicationManager.Manager.GetInstances<ISessionFactory>().First();
     112        sessionFactory.DbConnectionType = typeof(SqlConnection);
     113        sessionFactory.DbConnectionString = HeuristicLab.Hive.Server.Core.Properties.Settings.Default.HiveServerConnectionString;
     114      }
     115
     116      return sessionFactory;
     117    }
     118
     119    /// <summary>
     120    /// Gets the scheduler
     121    /// </summary>
     122    /// <returns></returns>
     123    [MethodImpl(MethodImplOptions.Synchronized)]
     124    public static IScheduler GetScheduler() {
     125      if (scheduler == null) {
     126        scheduler = ApplicationManager.Manager.GetInstances<IScheduler>().First();
     127      }
     128
     129      return scheduler;
     130    }
     131
     132    /// <summary>
     133    /// Gets the permission manager
     134    /// </summary>
     135    /// <returns></returns>
     136    [MethodImpl(MethodImplOptions.Synchronized)]
     137    public static IPermissionManager GetPermissionManager() {
     138      if (permManager == null)
     139        permManager = ApplicationManager.Manager.GetInstances<IPermissionManager>().First();
     140      return permManager;
     141
     142    }
     143
     144    /// <summary>
     145    /// Gets the permission manager
     146    /// </summary>
     147    /// <returns></returns>
     148    [MethodImpl(MethodImplOptions.Synchronized)]
     149    public static IHivePermissionManager GetHivePermissionManager() {
     150      if (hivePermManager == null)
     151        hivePermManager = ApplicationManager.Manager.GetInstances<IHivePermissionManager>().First();
     152      return hivePermManager;
     153
     154    }
     155
     156    /// <summary>
     157    /// Gets the database context manager
     158    /// </summary>
     159    /// <returns></returns>
     160    [MethodImpl(MethodImplOptions.Synchronized)]
     161    public static IContextFactory GetContextFactory() {
     162      if (contextFactory == null)
     163        contextFactory = ApplicationManager.Manager.GetInstances<IContextFactory>().First();
     164      return contextFactory;
     165    }
    156166  }
    157167}
Note: See TracChangeset for help on using the changeset viewer.