Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/11 14:16:53 (14 years ago)
Author:
cneumuel
Message:

#1233

  • renamed UptimeCalendar and Appointment to Downtime
  • added service methods to delete plugins and get plugin by hash
  • made reverted TransactionManager change, made it non-static and added interface
  • moved magic numbers to application settings
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs

    r6426 r6452  
    113113    #endregion
    114114
    115     #region Appointment
    116     public static DT.Appointment ToDto(UptimeCalendar source) {
    117       if (source == null) return null;
    118       return new DT.Appointment { Id = source.UptimeCalendarId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
    119     }
    120     public static UptimeCalendar ToEntity(DT.Appointment source) {
    121       if (source == null) return null;
    122       var entity = new UptimeCalendar(); ToEntity(source, entity);
    123       return entity;
    124     }
    125     public static void ToEntity(DT.Appointment source, UptimeCalendar target) {
    126       if ((source != null) && (target != null)) {
    127         target.UptimeCalendarId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate;
     115    #region Downtimes
     116    public static DT.Downtime ToDto(Downtime source) {
     117      if (source == null) return null;
     118      return new DT.Downtime { Id = source.DowntimeId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
     119    }
     120    public static Downtime ToEntity(DT.Downtime source) {
     121      if (source == null) return null;
     122      var entity = new Downtime(); ToEntity(source, entity);
     123      return entity;
     124    }
     125    public static void ToEntity(DT.Downtime source, Downtime target) {
     126      if ((source != null) && (target != null)) {
     127        target.DowntimeId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate;
    128128      }
    129129    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj

    r6431 r6452  
    109109    <Compile Include="Properties\AssemblyInfo.cs" />
    110110    <None Include="Properties\AssemblyInfo.cs.frame" />
    111     <Compile Include="Properties\Settings.Designer.cs">
     111    <Compile Include="Settings.Designer.cs">
    112112      <AutoGen>True</AutoGen>
    113113      <DesignTimeSharedInput>True</DesignTimeSharedInput>
     
    130130      <SubType>Designer</SubType>
    131131    </None>
    132     <None Include="Properties\Settings.settings">
     132    <None Include="Settings.settings">
    133133      <Generator>SettingsSingleFileGenerator</Generator>
    134134      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs

    r6431 r6452  
    2424using System.Linq;
    2525using System.Linq.Expressions;
    26 using HeuristicLab.Services.Hive.Common;
    2726using HeuristicLab.Services.Hive.Common.DataTransfer;
    28 using HeuristicLab.Services.Hive.DataAccess.Properties;
    2927using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    3028
     
    3331    public static HiveDataContext CreateContext(bool longRunning = false) {
    3432      var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
    35       if (longRunning) context.CommandTimeout = (int)ApplicationConstants.LongRunningDatabaseCommandTimeout.TotalSeconds;     
     33      if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;     
    3634      return context;
    3735    }
     
    109107                           where child.ParentJobId == ar.Job.JobId
    110108                           select child).Count() > 0
    111                     orderby ar.Job.Priority, db.Random() descending
     109                    orderby ar.Job.Priority descending, db.Random()
    112110                    select Convert.ToDto(ar.Job);
    113111        return count == 0 ? query.ToArray() : query.Take(count).ToArray();
     
    127125                       && ar.Job.CoresNeeded <= slave.FreeCores
    128126                       && ar.Job.MemoryNeeded <= slave.FreeMemory
    129                     orderby ar.Job.Priority, db.Random() descending // take random job to avoid the race condition that occurs when this method is called concurrently (the same job would be returned)
     127                    orderby ar.Job.Priority descending, db.Random() // take random job to avoid the race condition that occurs when this method is called concurrently (the same job would be returned)
    130128                    select Convert.ToDto(ar.Job);
    131129        var waitingJobs = (count == 0 ? query : query.Take(count)).ToArray();
     
    634632    #endregion
    635633
    636     #region Appointment Methods
    637     public Appointment GetAppointment(Guid id) {
    638       using (var db = CreateContext()) {
    639         return Convert.ToDto(db.UptimeCalendars.SingleOrDefault(x => x.UptimeCalendarId == id));
    640       }
    641     }
    642 
    643     public IEnumerable<Appointment> GetAppointments(Expression<Func<UptimeCalendar, bool>> predicate) {
    644       using (var db = CreateContext()) {
    645         return db.UptimeCalendars.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
    646       }
    647     }
    648 
    649     public Guid AddAppointment(Appointment dto) {
    650       using (var db = CreateContext()) {
    651         var entity = Convert.ToEntity(dto);
    652         db.UptimeCalendars.InsertOnSubmit(entity);
    653         db.SubmitChanges();
    654         return entity.UptimeCalendarId;
    655       }
    656     }
    657 
    658     public void UpdateAppointment(Appointment dto) {
    659       using (var db = CreateContext()) {
    660         var entity = db.UptimeCalendars.FirstOrDefault(x => x.UptimeCalendarId == dto.Id);
    661         if (entity == null) db.UptimeCalendars.InsertOnSubmit(Convert.ToEntity(dto));
    662         else Convert.ToEntity(dto, entity);
    663         db.SubmitChanges();
    664       }
    665     }
    666 
    667     public void DeleteAppointment(Guid id) {
    668       using (var db = CreateContext()) {
    669         var entity = db.UptimeCalendars.FirstOrDefault(x => x.UptimeCalendarId == id);
    670         if (entity != null) db.UptimeCalendars.DeleteOnSubmit(entity);
     634    #region Downtime Methods
     635    public DT.Downtime GetDowntime(Guid id) {
     636      using (var db = CreateContext()) {
     637        return Convert.ToDto(db.Downtimes.SingleOrDefault(x => x.DowntimeId == id));
     638      }
     639    }
     640
     641    public IEnumerable<DT.Downtime> GetDowntimes(Expression<Func<Downtime, bool>> predicate) {
     642      using (var db = CreateContext()) {
     643        return db.Downtimes.Where(predicate).Select(x => Convert.ToDto(x)).ToArray();
     644      }
     645    }
     646
     647    public Guid AddDowntime(DT.Downtime dto) {
     648      using (var db = CreateContext()) {
     649        var entity = Convert.ToEntity(dto);
     650        db.Downtimes.InsertOnSubmit(entity);
     651        db.SubmitChanges();
     652        return entity.DowntimeId;
     653      }
     654    }
     655
     656    public void UpdateDowntime(DT.Downtime dto) {
     657      using (var db = CreateContext()) {
     658        var entity = db.Downtimes.FirstOrDefault(x => x.DowntimeId == dto.Id);
     659        if (entity == null) db.Downtimes.InsertOnSubmit(Convert.ToEntity(dto));
     660        else Convert.ToEntity(dto, entity);
     661        db.SubmitChanges();
     662      }
     663    }
     664
     665    public void DeleteDowntime(Guid id) {
     666      using (var db = CreateContext()) {
     667        var entity = db.Downtimes.FirstOrDefault(x => x.DowntimeId == id);
     668        if (entity != null) db.Downtimes.DeleteOnSubmit(entity);
    671669        db.SubmitChanges();
    672670      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml

    r6431 r6452  
    11<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
     2  <Connection Mode="AppSettings" ConnectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True" SettingsObjectName="HeuristicLab.Services.Hive.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_Hive_LinqConnectionString" Provider="System.Data.SqlClient" />
    23  <Table Name="dbo.AssignedResources" Member="AssignedResources">
    34    <Type Name="AssignedResource">
     
    3839      <Association Name="Resource_AssignedResource" Member="AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedResource" />
    3940      <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
    40       <Association Name="Resource_UptimeCalendar" Member="UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="UptimeCalendar" />
     41      <Association Name="Resource_Downtime" Member="Downtimes" Storage="_UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="Downtime" />
    4142      <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
    4243      <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
     
    8283    </Type>
    8384  </Table>
    84   <Table Name="dbo.UptimeCalendar" Member="UptimeCalendars">
    85     <Type Name="UptimeCalendar">
    86       <Column Name="UptimeCalendarId" Type="System.Guid" DbType="UniqueIdentifier" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
     85  <Table Name="dbo.Downtime" Member="Downtimes">
     86    <Type Name="Downtime">
     87      <Column Name="DowntimeId" Storage="_UptimeCalendarId" Type="System.Guid" DbType="UniqueIdentifier" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    8788      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    8889      <Column Name="StartDate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
     
    9192      <Column Name="Recurring" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
    9293      <Column Name="RecurringId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
    93       <Association Name="Resource_UptimeCalendar" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
     94      <Association Name="Resource_Downtime" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
    9495    </Type>
    9596  </Table>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout

    r6431 r6452  
    3434    </classShape>
    3535    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="13.5, 2.5, 2, 2.1554996744791666">
    36       <DataClassMoniker Name="/HiveDataContext/UptimeCalendar" />
     36      <DataClassMoniker Name="/HiveDataContext/Downtime" />
    3737      <nestedChildShapes>
    3838        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="13.515, 2.9600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     
    6969      </nodes>
    7070    </inheritanceConnector>
    71     <associationConnector edgePoints="[(11.9843735 : 2.57859537760417); (11.9843735 : 4.69314697265625); (10.875 : 4.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     71    <associationConnector edgePoints="[(12.25 : 2.57859537760417); (12.25 : 4.69314697265625); (10.875 : 4.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    7272      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
    7373      <nodes>
     
    9797      </nodes>
    9898    </associationConnector>
    99     <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.54212367513021); (13.5 : 3.54212367513021)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    100       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" />
    101       <nodes>
    102         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
    103         <classShapeMoniker Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" />
    104       </nodes>
    105     </associationConnector>
    10699    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
    107100      <DataClassMoniker Name="/HiveDataContext/JobData" />
     
    228221      </nodes>
    229222    </associationConnector>
     223    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.64829952604167); (13.5 : 3.64829952604167)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     224      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Downtime" />
     225      <nodes>
     226        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
     227        <classShapeMoniker Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" />
     228      </nodes>
     229    </associationConnector>
    230230  </nestedChildShapes>
    231231</ordesignerObjectsDiagram>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs

    r6431 r6452  
    1212namespace HeuristicLab.Services.Hive.DataAccess
    1313{
    14   using System.Data.Linq;
    15   using System.Data.Linq.Mapping;
    16   using System.Data;
    17   using System.Collections.Generic;
    18   using System.Reflection;
    19   using System.Linq;
    20   using System.Linq.Expressions;
    21   using System.ComponentModel;
    22   using System;
     14  using System;
     15  using System.ComponentModel;
     16  using System.Data.Linq;
     17  using System.Data.Linq.Mapping;
    2318 
    2419 
     
    4641    partial void UpdateJob(Job instance);
    4742    partial void DeleteJob(Job instance);
    48     partial void InsertUptimeCalendar(UptimeCalendar instance);
    49     partial void UpdateUptimeCalendar(UptimeCalendar instance);
    50     partial void DeleteUptimeCalendar(UptimeCalendar instance);
     43    partial void InsertDowntime(Downtime instance);
     44    partial void UpdateDowntime(Downtime instance);
     45    partial void DeleteDowntime(Downtime instance);
    5146    partial void InsertHiveExperiment(HiveExperiment instance);
    5247    partial void UpdateHiveExperiment(HiveExperiment instance);
     
    8176    #endregion
    8277   
     78    public HiveDataContext() :
     79        base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)
     80    {
     81      OnCreated();
     82    }
     83   
    8384    public HiveDataContext(string connection) :
    8485        base(connection, mappingSource)
     
    145146    }
    146147   
    147     public System.Data.Linq.Table<UptimeCalendar> UptimeCalendars
    148     {
    149       get
    150       {
    151         return this.GetTable<UptimeCalendar>();
     148    public System.Data.Linq.Table<Downtime> Downtimes
     149    {
     150      get
     151      {
     152        return this.GetTable<Downtime>();
    152153      }
    153154    }
     
    877878    private EntitySet<Resource> _ChildResources;
    878879   
    879     private EntitySet<UptimeCalendar> _UptimeCalendars;
     880    private EntitySet<Downtime> _UptimeCalendars;
    880881   
    881882    private EntitySet<StateLog> _StateLogs;
     
    901902      this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));
    902903      this._ChildResources = new EntitySet<Resource>(new Action<Resource>(this.attach_ChildResources), new Action<Resource>(this.detach_ChildResources));
    903       this._UptimeCalendars = new EntitySet<UptimeCalendar>(new Action<UptimeCalendar>(this.attach_UptimeCalendars), new Action<UptimeCalendar>(this.detach_UptimeCalendars));
     904      this._UptimeCalendars = new EntitySet<Downtime>(new Action<Downtime>(this.attach_UptimeCalendars), new Action<Downtime>(this.detach_UptimeCalendars));
    904905      this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
    905906      this._ParentResource = default(EntityRef<Resource>);
     
    10171018    }
    10181019   
    1019     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
    1020     public EntitySet<UptimeCalendar> UptimeCalendars
     1020    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_UptimeCalendars", ThisKey="ResourceId", OtherKey="ResourceId")]
     1021    public EntitySet<Downtime> Downtimes
    10211022    {
    10221023      get
     
    11211122    }
    11221123   
    1123     private void attach_UptimeCalendars(UptimeCalendar entity)
     1124    private void attach_UptimeCalendars(Downtime entity)
    11241125    {
    11251126      this.SendPropertyChanging();
     
    11271128    }
    11281129   
    1129     private void detach_UptimeCalendars(UptimeCalendar entity)
     1130    private void detach_UptimeCalendars(Downtime entity)
    11301131    {
    11311132      this.SendPropertyChanging();
     
    20402041  }
    20412042 
    2042   [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UptimeCalendar")]
    2043   public partial class UptimeCalendar : INotifyPropertyChanging, INotifyPropertyChanged
     2043  [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Downtime")]
     2044  public partial class Downtime : INotifyPropertyChanging, INotifyPropertyChanged
    20442045  {
    20452046   
     
    20662067    partial void OnValidate(System.Data.Linq.ChangeAction action);
    20672068    partial void OnCreated();
    2068     partial void OnUptimeCalendarIdChanging(System.Guid value);
    2069     partial void OnUptimeCalendarIdChanged();
     2069    partial void OnDowntimeIdChanging(System.Guid value);
     2070    partial void OnDowntimeIdChanged();
    20702071    partial void OnResourceIdChanging(System.Guid value);
    20712072    partial void OnResourceIdChanged();
     
    20822083    #endregion
    20832084   
    2084     public UptimeCalendar()
     2085    public Downtime()
    20852086    {
    20862087      this._Resource = default(EntityRef<Resource>);
     
    20892090   
    20902091    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UptimeCalendarId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier", IsPrimaryKey=true, IsDbGenerated=true)]
    2091     public System.Guid UptimeCalendarId
     2092    public System.Guid DowntimeId
    20922093    {
    20932094      get
     
    20992100        if ((this._UptimeCalendarId != value))
    21002101        {
    2101           this.OnUptimeCalendarIdChanging(value);
     2102          this.OnDowntimeIdChanging(value);
    21022103          this.SendPropertyChanging();
    21032104          this._UptimeCalendarId = value;
    2104           this.SendPropertyChanged("UptimeCalendarId");
    2105           this.OnUptimeCalendarIdChanged();
     2105          this.SendPropertyChanged("DowntimeId");
     2106          this.OnDowntimeIdChanged();
    21062107        }
    21072108      }
     
    22322233    }
    22332234   
    2234     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_UptimeCalendar", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
     2235    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_Downtime", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
    22352236    public Resource Resource
    22362237    {
     
    22492250          {
    22502251            this._Resource.Entity = null;
    2251             previousValue.UptimeCalendars.Remove(this);
     2252            previousValue.Downtimes.Remove(this);
    22522253          }
    22532254          this._Resource.Entity = value;
    22542255          if ((value != null))
    22552256          {
    2256             value.UptimeCalendars.Add(this);
     2257            value.Downtimes.Add(this);
    22572258            this._ResourceId = value.ResourceId;
    22582259          }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs

    r6431 r6452  
    129129    #endregion
    130130
    131     #region Appointment Methods
    132     DT.Appointment GetAppointment(Guid id);
    133     IEnumerable<DT.Appointment> GetAppointments(Expression<Func<UptimeCalendar, bool>> predicate);
    134     Guid AddAppointment(DT.Appointment dto);
    135     void UpdateAppointment(DT.Appointment dto);
    136     void DeleteAppointment(Guid id);
     131    #region Downtime Methods
     132    DT.Downtime GetDowntime(Guid id);
     133    IEnumerable<DT.Downtime> GetDowntimes(Expression<Func<Downtime, bool>> predicate);
     134    Guid AddDowntime(DT.Downtime dto);
     135    void UpdateDowntime(DT.Downtime dto);
     136    void DeleteDowntime(Guid id);
    137137    #endregion
    138138
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/Prepare Hive Database.sql

    r6431 r6452  
    7373ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (NEWSEQUENTIALID()) FOR ResourceId;
    7474
    75 ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId ADD ROWGUIDCOL;
    76 ALTER TABLE dbo.UptimeCalendar WITH NOCHECK ADD CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId] DEFAULT (NEWSEQUENTIALID()) FOR UptimeCalendarId;
     75ALTER TABLE dbo.Downtime ALTER COLUMN DowntimeId ADD ROWGUIDCOL;
     76ALTER TABLE dbo.Downtime WITH NOCHECK ADD CONSTRAINT [DF_Downtime_DowntimeId] DEFAULT (NEWSEQUENTIALID()) FOR DowntimeId;
    7777
    7878ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId ADD ROWGUIDCOL;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/TransactionManager.cs

    r6444 r6452  
    2424using HeuristicLab.Services.Hive.Common;
    2525
    26 namespace HeuristicLab.Services.Hive.DataAccess {
    27   public static class TransactionManager {
    28     public static void UseTransaction(Action call, bool serializable = false, bool longRunning = false) {
     26namespace HeuristicLab.Services.Hive.DataAccess { 
     27  public class TransactionManager : ITransactionManager {   
     28    public void UseTransaction(Action call, bool serializable = false, bool longRunning = false) {
    2929      int n = 10;
    3030      while (n > 0) {
     
    4646    }
    4747
    48     public static T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false) {
     48    public T UseTransaction<T>(Func<T> call, bool serializable = false, bool longRunning = false) {
    4949      int n = 10;
    5050      while (n > 0) {
     
    6868    }
    6969
    70     private static TransactionScope CreateTransaction(bool serializable, bool longRunning) {
     70    private TransactionScope CreateTransaction(bool serializable, bool longRunning) {
    7171      var options = new TransactionOptions();
    7272      if (serializable)
     
    7676
    7777      if (longRunning)
    78         options.Timeout = ApplicationConstants.LongRunningDatabaseCommandTimeout;
     78        options.Timeout = Settings.Default.LongRunningDatabaseCommandTimeout;
    7979
    8080      return new TransactionScope(TransactionScopeOption.Required, options);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/app.config

    r5264 r6452  
    22<configuration>
    33  <configSections>
     4    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
     5      <section name="HeuristicLab.Services.Hive.DataAccess.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
     6    </sectionGroup>
    47  </configSections>
    58  <connectionStrings>
    6     <add name="HeuristicLab.Services.Hive.DataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString" connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;" providerName="System.Data.SqlClient"/>
     9    <add name="HeuristicLab.Services.Hive.DataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString"
     10      connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.4;Integrated Security=True;"
     11      providerName="System.Data.SqlClient" />
    712  </connectionStrings>
    8 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
     13<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><applicationSettings>
     14    <HeuristicLab.Services.Hive.DataAccess.Settings>
     15      <setting name="LongRunningDatabaseCommandTimeout" serializeAs="String">
     16        <value>00:05:00</value>
     17      </setting>
     18    </HeuristicLab.Services.Hive.DataAccess.Settings>
     19  </applicationSettings>
     20</configuration>
Note: See TracChangeset for help on using the changeset viewer.