Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/23/09 11:35:41 (15 years ago)
Author:
svonolfe
Message:

Avoid out of memory exceptions related to job objects (#372)

File:
1 edited

Legend:

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

    r2066 r2082  
    166166          job.Percentage = 0.0;
    167167
    168         if (!row.IsSerializedJobNull())
    169           job.SerializedJob = row.SerializedJob;
    170         else
    171           job.SerializedJob = null;
    172 
    173168        if (!row.IsDateCreatedNull())
    174169          job.DateCreated = row.DateCreated;
     
    255250
    256251        row.Percentage = job.Percentage;
    257 
    258         row.SerializedJob = job.SerializedJob;
    259252
    260253        if (job.DateCreated != DateTime.MinValue)
     
    422415    }
    423416
     417    /// <summary>
     418    /// Gets the computable job with the secified jobId
     419    /// </summary>
     420    /// <param name="jobId"></param>
     421    /// <returns></returns>
     422    public ComputableJob GetComputableJob(Guid jobId) {
     423      return (ComputableJob)base.doInTransaction(
     424        delegate() {
     425          ComputableJob job =
     426            new ComputableJob();
     427
     428          job.JobInfo = GetById(jobId);
     429          dsHiveServer.JobRow row
     430            = GetRowById(jobId);
     431
     432          if (job.JobInfo != null && row != null &&
     433            !row.IsSerializedJobNull()) {
     434
     435            job.SerializedJob =
     436              row.SerializedJob;
     437
     438            return job;
     439          } else {
     440            return null;
     441          }
     442        });
     443    }
     444
     445    /// <summary>
     446    /// Saves or update the computable job
     447    /// </summary>
     448    /// <param name="jobId"></param>
     449    public void UpdateComputableJob(ComputableJob job) {
     450      if(job != null &&
     451        job.JobInfo != null) {
     452        base.doInTransaction(
     453          delegate() {
     454            dsHiveServer.JobRow row
     455              = GetRowById(job.JobInfo.Id);
     456
     457            if (row != null) {
     458              Update(job.JobInfo);
     459              row.SerializedJob =
     460                job.SerializedJob;
     461
     462              base.Adapter.Update(row);
     463            }
     464
     465            return true;
     466          });
     467      }
     468     
     469    }
     470
    424471    #endregion
    425472  }
Note: See TracChangeset for help on using the changeset viewer.