Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/09 13:54:15 (15 years ago)
Author:
svonolfe
Message:

Further avoided out of memory exceptions by updating the JobResult DAO (#372)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/JobResultsAdapter.cs

    r2086 r2099  
    5555          row.SetJobIdNull();
    5656
    57         if (result.Result != null)
    58           row.JobResult = result.Result;
    59         else
    60           row.SetJobResultNull();
    61 
    6257        if (result.ClientId != Guid.Empty)  {
    6358          ClientInfo client =
     
    9994          result.JobId = Guid.Empty;
    10095
    101         if (!row.IsJobResultNull())
    102           result.Result = row.JobResult;
    103         else
    104           result.Result = null;
    105 
    10696        if (!row.IsResourceIdNull())
    10797          result.ClientId = row.ResourceId;
     
    128118
    129119    #region IJobResultsAdapter Members
    130     public ICollection<JobResult> GetResultsOf(Job job) {
    131       if (job != null) {
     120    public ICollection<JobResult> GetResultsOf(Guid jobId) {
    132121        return
    133122          base.FindMultiple(
    134123            delegate() {
    135               return Adapter.GetDataByJob(job.Id);
     124              return Adapter.GetDataByJob(jobId);
    136125            });
    137       }
    138 
    139       return null;
    140126    }
    141127
    142     public JobResult GetLastResultOf(Job job) {
    143        if (job != null) {
     128    public JobResult GetLastResultOf(Guid jobId) {
    144129        return
    145130          base.FindSingle(
    146131            delegate() {
    147               return Adapter.GetDataByLastResult(job.Id);
     132              return Adapter.GetDataByLastResult(jobId);
    148133            });
     134    }
     135
     136    public SerializedJobResult GetSerializedJobResult(Guid jobResultId) {
     137      return (SerializedJobResult)base.doInTransaction(
     138        delegate() {
     139          SerializedJobResult jobResult =
     140            new SerializedJobResult();
     141
     142          jobResult.JobResult = GetById(jobResultId);
     143          if (jobResult.JobResult != null) {
     144            jobResult.SerializedJobResultData =
     145              base.Adapter.GetSerializedJobResultById(jobResultId);
     146
     147            return jobResult;
     148          } else {
     149            return null;
     150          }
     151        });
     152    }
     153
     154    public void UpdateSerializedJobResult(SerializedJobResult jobResult) {
     155      if (jobResult != null &&
     156        jobResult.JobResult != null) {
     157        base.doInTransaction(
     158          delegate() {
     159            Update(jobResult.JobResult);
     160            return base.Adapter.UpdateSerializedJobResultById(
     161              jobResult.SerializedJobResultData,
     162              jobResult.JobResult.Id);
     163          });
    149164      }
    150 
    151       return null;
    152165    }
    153166    #endregion
Note: See TracChangeset for help on using the changeset viewer.