Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/23/18 15:42:13 (7 years ago)
Author:
jzenisek
Message:

#2839

  • worked on UpdateJob(..)
  • adapted permission and assignment handling methods
  • adpated dbml of HiveDataContext using the designer (added delete rules and onNull-handling)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/JobDao.cs

    r15630 r15643  
    4545    }
    4646
     47    public IEnumerable<Job> GetJobsReadyForDeletion() {
     48      return GetJobsReadyForDeletionQuery(DataContext);
     49    }
     50
    4751
    4852    #region Compiled queries
     
    6266         where job.State == jobState
    6367         select job.JobId).ToList());
     68    private static readonly Func<DataContext, IEnumerable<Job>> GetJobsReadyForDeletionQuery =
     69      CompiledQuery.Compile((DataContext db) =>
     70        (from job in db.GetTable<Job>()
     71         where job.State == JobState.StatisticsPending
     72         && (from task in db.GetTable<Task>()
     73             where task.JobId == job.JobId
     74             select task.State == TaskState.Finished
     75              || task.State == TaskState.Aborted
     76              || task.State == TaskState.Failed).All(x => x)
     77         select job).ToList());
    6478    #endregion
    6579
     
    6983      WHERE JobState = {0}
    7084    ";
     85    private const string GetStatisticsPendingJobs = @"
     86      SELECT DISTINCT j.*
     87      FROM [Job] j
     88      WHERE j.JobState = 'StatisticsPending'
     89      AND 'Calculating' NOT IN (
     90        SELECT t.TaskState
     91        FROM [Task] t
     92        WHERE t.JobId = j.JobId)
     93    ";
    7194    #endregion
    7295  }
Note: See TracChangeset for help on using the changeset viewer.